[U-Boot] [PATCH 3/7] mpc85xx: Add inline GPIO acessor functions

Moffett, Kyle D Kyle.D.Moffett at boeing.com
Mon Feb 21 23:13:52 CET 2011


On Feb 21, 2011, at 16:56, Wolfgang Denk wrote:
> In message <D99CA72A-BD3E-475D-B17F-1253410C6591 at boeing.com> you wrote:
>> 
>>>> +static inline int gpio_direction_input(unsigned gpio)
>>>> +{
>>>> +	mpc85xx_gpio_set_in(1U << gpio);
>>>> +	return 0;
>>>> +}
>>> 
>>> Why is this function not void when it cannot return any usefult return
>>> code anyway?
>>> 
>>>> +static inline int gpio_direction_output(unsigned gpio, int value)
>>>> +{
>>>> +	mpc85xx_gpio_set_low(1U << gpio);
>>>> +	return 0;
>>>> +}
>>> 
>>> Ditto.
>> 
>> This is the "Linux-compatible" gpio layer that Peter Tyser was asking
>> for.  I sort-of-copied most of these functions from
>> arch/nios2/include/asm/gpio.h, which just does the "return 0;" in
>> several functions.
>> Those 2 later functions are expected to be able to return an error (for
>> I2C chips and such).  As I said above, if these wrappers are
>> unacceptable then I will just delete them; the only thing I use are the
>> mpc85xx_gpio_*() functions.
> 
> It's not unacceptable, but maybe you add a comment to explain why
> these return int.

Ok, will fix, thanks.


>> --Apple-Mail-2-42328377
>> Content-Disposition: attachment; filename"smime.p7s"
>> Content-Type: application/pkcs7-signature; name"smime.p7s"
>> Content-Transfer-Encoding: base64
> 
> Do you really have to append a 120 line binary encoded signature here?

Ah, crap, somehow S/MIME signatures got turned on.  It's a tiny checkbox in the corner of the GUI.  Sorry!

Cheers,
Kyle Moffett


More information about the U-Boot mailing list