[U-Boot] [PATCH v2 2/9] sunxi: initial sun7i pinmux and gpio support

Wolfgang Denk
2014-03-26T09:03:26Z

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.

Thanks.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
EMACS belongs in <sys/errno.h>: Editor too big!