Re: [U-Boot] [PATCH] M28: Added pin name support in GPIO driver

2011-11-23 Thread Mike Frysinger
On Tuesday 22 November 2011 17:37:49 Marek Vasut wrote: > > like Marek wants, and then the header simply does: > > extern int name_to_gpio(unsigned gpio); > > #define name_to_gpio(gpio) name_to_gpio(gpio) > > Man, this is really ... urgh. But fine, it's better than it was anyway. this is

Re: [U-Boot] [PATCH] M28: Added pin name support in GPIO driver

2011-11-23 Thread Mike Frysinger
On Wednesday 23 November 2011 04:51:45 Robert Deliën wrote: > + if (name[0] >= '0' && name[0] <= '9') { > + pin_nr = simple_strtoul(name, (char **)&name, 10); > + if (name[0]) > + return -EINVAL; > > Why do we need this check ? We have alread

Re: [U-Boot] [PATCH] M28: Added pin name support in GPIO driver

2011-11-23 Thread Robert Deliën
> Man, this is really ... urgh. But fine, it's better than it was anyway. I'm getting the impression that the "better than it was"-standard isn't applied consistently. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-

Re: [U-Boot] [PATCH] M28: Added pin name support in GPIO driver

2011-11-23 Thread Robert Deliën
+ if (name[0] >= '0' && name[0] <= '9') { + pin_nr = simple_strtoul(name, (char **)&name, 10); + if (name[0]) + return -EINVAL; Why do we need this check ? We have already copied / converted the number in pin_nr, we do not need to check in th

Re: [U-Boot] [PATCH] M28: Added pin name support in GPIO driver

2011-11-23 Thread Stefano Babic
On 22/11/2011 16:40, Robert Deliën wrote: > This patch adds adds pin name support in the GPIO driver. With this patch > applied, the gpio command supports pins to be addressed with friendly names. > > The user's manual refers to pins by the bank number they're in and their > number within that b

Re: [U-Boot] [PATCH] M28: Added pin name support in GPIO driver

2011-11-22 Thread Marek Vasut
> On Tuesday 22 November 2011 15:49:06 Robert Deliën wrote: > > Of course name_to_gpio could be a non-static function, allowing it to be > > used by other parts of the code too. And for that reason do_gpio could be > > non-static too. But that would still require an ifdef-orgy like this to > > >

Re: [U-Boot] [PATCH] M28: Added pin name support in GPIO driver

2011-11-22 Thread Mike Frysinger
On Tuesday 22 November 2011 15:49:06 Robert Deliën wrote: > Of course name_to_gpio could be a non-static function, allowing it to be > used by other parts of the code too. And for that reason do_gpio could be > non-static too. But that would still require an ifdef-orgy like this to > make it work

Re: [U-Boot] [PATCH] M28: Added pin name support in GPIO driver

2011-11-22 Thread Mike Frysinger
On Tuesday 22 November 2011 10:40:24 Robert Deliën wrote: > +static inline int name_to_gpio(const char *name) > +{ > + int pin_nr; single space after that "int" > + if (name[0] >= '0' && name[0] <= '9') { > + pin_nr = simple_strtoul(name, (char **)&name, 10); NAK: t

Re: [U-Boot] [PATCH] M28: Added pin name support in GPIO driver

2011-11-22 Thread Mike Frysinger
please fix your client to properly wrap long lines in the non-patch area -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

Re: [U-Boot] [PATCH] M28: Added pin name support in GPIO driver

2011-11-22 Thread Robert Deliën
> I don't think I follow ... don't you only have to define the function and > that's > it? No, it's a bit more complicated than that. It wouldn't be my choice either, but now I'm familiar with it, I find it quite charming. Let me see if I can explain: Check out common/cmd_gpio.c. The first par

Re: [U-Boot] [PATCH] M28: Added pin name support in GPIO driver

2011-11-22 Thread Marek Vasut
> > No, move this to mxs_gpio.c and simply make the function not static. > > I too find the construction a little strange, but I copied it from the > Blackfin implementation. > > But after taking a second look at it, it made sense: It makes the file > pulling including it, define it statically lo

Re: [U-Boot] [PATCH] M28: Added pin name support in GPIO driver

2011-11-22 Thread Robert Deliën
> No, move this to mxs_gpio.c and simply make the function not static. I too find the construction a little strange, but I copied it from the Blackfin implementation. But after taking a second look at it, it made sense: It makes the file pulling including it, define it statically locally. The m

Re: [U-Boot] [PATCH] M28: Added pin name support in GPIO driver

2011-11-22 Thread Marek Vasut
> This patch adds adds pin name support in the GPIO driver. With this patch > applied, the gpio command supports pins to be addressed with friendly > names. > > The user's manual refers to pins by the bank number they're in and their > number within that bank. With this patch the friendly naming c

[U-Boot] [PATCH] M28: Added pin name support in GPIO driver

2011-11-22 Thread Robert Deliën
This patch adds adds pin name support in the GPIO driver. With this patch applied, the gpio command supports pins to be addressed with friendly names. The user's manual refers to pins by the bank number they're in and their number within that bank. With this patch the friendly naming convention