Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752656AbbDCNiP (ORCPT ); Fri, 3 Apr 2015 09:38:15 -0400 Received: from mail-la0-f47.google.com ([209.85.215.47]:36226 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751772AbbDCNiL (ORCPT ); Fri, 3 Apr 2015 09:38:11 -0400 MIME-Version: 1.0 In-Reply-To: <1428002603-21892-4-git-send-email-jonathar@broadcom.com> References: <1428002603-21892-1-git-send-email-jonathar@broadcom.com> <1428002603-21892-4-git-send-email-jonathar@broadcom.com> Date: Fri, 3 Apr 2015 16:38:09 +0300 Message-ID: Subject: Re: [PATCH 3/4] spi: bcm-mspi: Make BCMA optional to support non-BCMA chips From: Andy Shevchenko To: Jonathan Richardson Cc: Mark Brown , Dmitry Torokhov , Anatol Pomazau , Scott Branden , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , "linux-kernel@vger.kernel.org" , linux-spi@vger.kernel.org, bcm-kernel-feedback-list , devicetree , Rafal Milecki Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1198 Lines: 33 On Thu, Apr 2, 2015 at 10:23 PM, Jonathan Richardson wrote: > The Broadcom MSPI controller is used on various chips. The driver only > supported BCM53xx chips with BCMA (an AMBA bus variant). The driver is > refactored to make BCMA optional and provides a new config for non BCMA > systems. > struct bcm_mspi { > + #ifdef CONFIG_SPI_BCMA_MSPI > struct bcma_device *core; > - struct spi_master *master; > + #endif > > + void __iomem *base; > + struct spi_master *master; > size_t read_offset; > + void (*mspi_write)(struct bcm_mspi *mspi, u16 offset, u32 value); > + u32 (*mspi_read)(struct bcm_mspi *mspi, u16 offset); > +}; To avoid ugly ifdefs I think better to split driver to core part and the actual driver part, at the end you will have something like mspi-core.c mspi-53xx.c mspi-whatever.c. Check for example spi-dw*.c -- With Best Regards, Andy Shevchenko -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/