From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Wed, 26 Mar 2014 11:03:02 +0100 Subject: [U-Boot] [PATCH v2 2/9] sunxi: initial sun7i pinmux and gpio support In-Reply-To: <1395826756.22808.13.camel@kazak.uk.xensource.com> References: <1395438845.2234.95.camel@hastur.hellion.org.uk> <20140326090326.099793814B8@gemini.denx.de> <1395826756.22808.13.camel@kazak.uk.xensource.com> Message-ID: <201403261103.02393.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wednesday, March 26, 2014 at 10:39:16 AM, Ian Campbell wrote: > On Wed, 2014-03-26 at 10:03 +0100, Wolfgang Denk wrote: > > Dear Ian Campbell, > > > > In message <1395822781.29683.12.camel@dagon.hellion.org.uk> you wrote: > > > On Mon, 2014-03-24 at 21:54 +0100, Marek Vasut wrote: > > > > > +int sunxi_gpio_set_cfgpin(u32 pin, u32 val); > > > > > +int sunxi_gpio_get_cfgpin(u32 pin); > > > > > +int sunxi_gpio_set_drv(u32 pin, u32 val); > > > > > +int sunxi_gpio_set_pull(u32 pin, u32 val); > > > > > +int name_to_gpio(const char *name); > > > > > +#define name_to_gpio name_to_gpio > > > > > > > > What is this ugly define doing here ? > > > > > > common/cmd_gpio.c uses the #ifndef name_to_gpio pattern to provide (or > > > not) a default fallback implementation. I think this is a reasonably > > > (but not very) common idiom for such cases where the non-default > > > variant is not best expressed as a macro. > > > > Please add a comment to explain that. > > Unless you object I think I'll do as Marek suggested name the function > sunxi_name_to_gpio and make the #define to that, it seems more > consistent that way. I'd suggest you fix cmd_gpio.c while at it too ;-) Best regards, Marek Vasut