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
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
> 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-
+ 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
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
> 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
>
> >
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
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
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
> 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
> > 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
> 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
> 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
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
14 matches
Mail list logo