From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH 05/14] gpio: lpc32xx: allow building on non-lpc32xx targets Date: Fri, 2 Aug 2019 13:19:55 +0200 Message-ID: References: <20190731195713.3150463-1-arnd@arndb.de> <20190731195713.3150463-6-arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Bartosz Golaszewski Cc: Andrew Lunn , LINUXWATCHDOG , LKML , Jason Cooper , "David S. Miller" , Greg Kroah-Hartman , Gregory Clement , USB list , Russell King , Vladimir Zapolskiy , linux-gpio , soc@kernel.org, netdev , Alan Stern , Guenter Roeck , linux-serial@vger.kernel.org, Sylvain Lemieux , Lee Jones , Linus Walleij , arm-soc , Sebastian Hesselbarth List-Id: linux-serial@vger.kernel.org On Fri, Aug 2, 2019 at 9:10 AM Bartosz Golaszewski wrote: > > -#include > > -#include > > +#define _GPREG(x) (x) > > What purpose does this macro serve? > > > > > #define LPC32XX_GPIO_P3_INP_STATE _GPREG(0x000) > > #define LPC32XX_GPIO_P3_OUTP_SET _GPREG(0x004) In the existing code base, this macro converts a register offset to an __iomem pointer for a gpio register. I changed the definition of the macro here to keep the number of changes down, but I it's just as easy to remove it if you prefer. > > @@ -167,14 +166,26 @@ struct lpc32xx_gpio_chip { > > struct gpio_regs *gpio_grp; > > }; > > > > +void __iomem *gpio_reg_base; > > Any reason why this can't be made part of struct lpc32xx_gpio_chip? It could be, but it's the same for each instance, and not known until probe() time, so the same pointer would need to be copied into each instance that is otherwise read-only. Let me know if you'd prefer me to rework these two things or leave them as they are. > > +static inline u32 gpreg_read(unsigned long offset) > > Here and elsewhere: could you please keep the lpc32xx_gpio prefix for > all symbols? Sure. Arnd