[PATCH] pinctrl: Add SPEAr pinctrl drivers

Stephen Warren swarren at wwwdotorg.org
Tue Apr 3 18:43:39 EDT 2012


On 04/03/2012 03:24 PM, Linus Walleij wrote:
> On Tue, Apr 3, 2012 at 3:47 PM, Arnd Bergmann <arnd at arndb.de> wrote:
> 
>> The initialization order dependencies can now be handled using
>> the deferred probe mechanism, by returning -EPROBE_DEFER from
>> the probe() function of any driver that is loaded before its
>> pins are available.
> 
> So how do I as a driver writer do that?
> 
> Example: drivers/tty/serial/sirfsoc_uart.c:
> 
> #include <linux/pinctrl/consumer.h>
> 
> probe() {
>        if (sirfport->hw_flow_ctrl) {
>                 sirfport->p = pinctrl_get_select_default(&pdev->dev);
>                 ret = IS_ERR(sirfport->p);
>                 if (ret)
>                         goto pin_err;
>         }
> 
> pin_err:
>     (...)
>    return ret;
> 
> So basically the pinctrl subsystem needs to return -EPROBE_DEFER
> to the driver in this case, so it can escalate that further.

Yes, I believe so.

There should be a couple of comments in pinctrl now (well, perhaps some
of them aren't there yet until my DT patches are applied!) that indicate
where -EPROBE_DEFER should be returned.



More information about the linux-arm-kernel mailing list