[U-Boot] [PATCH 06/10] dm: imx: Use gpio_request() to request GPIOs

Igor Grinberg grinberg at compulab.co.il
Mon Sep 15 20:36:47 CEST 2014


On 09/15/14 21:04, Simon Glass wrote:
> Hi Igor,
> 
> On 15 September 2014 11:13, Igor Grinberg <grinberg at compulab.co.il> wrote:
>> Hi Simon,
>>
>> On 09/15/14 15:57, Simon Glass wrote:
>>> GPIOs should be requested before use. Without this, driver model will not
>>> permit the GPIO to be used.

[...]

>>
>> In all the above gpio_request() calls, I think we should check for
>> the return value.
>> Because after patch 8 in the series it can fail if if someone
>> double requests the same gpio.
> 
> That's true, although for a particular board you presumably know what
> you are doing. The problem happens more when we move this sort of
> thing to drivers, and there is a conflict.
> 
> In some cases there is not way to report an error (void functions),
> and in others it needs additional plumbing. But I agree we should
> start to fix this sort of thing.

Ok. So for the board code, which is the current user of
gpio_request() function, I would at least add an error message and
stop trying to access the "failed to request" gpio.

-- 
Regards,
Igor.


More information about the U-Boot mailing list