[PATCH 1/2] ohci-platform: Add support for devicetree instantiation

Hans de Goede hdegoede at redhat.com
Wed Jan 8 11:00:53 EST 2014


Hi,

On 01/06/2014 08:50 AM, Hans de Goede wrote:

<snip>

>> Otherwise you don't know the difference between "no clock
>> provided", "error getting the clock reference" and "clock controller not
>> initialized yet, try again".
>
> I guess of these 3 we really only want to continue on "no clock provided",
> so I think something like this (for both clks and the phy) would be best:
>
>          priv->ahb_clk = devm_clk_get(&dev->dev, "ahb");
>          if (IS_ERR(priv->ahb_clk)) {
>              err = PTR_ERR(priv->ahb_clk);
>              if (err != -EINVAL && err != -ENODATA)
>                  goto err_put_hcd;
>              priv->ahb_clk = NULL; /* No clock provided */
>          }
>
> To clarify -EINVAL will be returned when there is no clock-names, and
> -ENODATA when the specified name is not found in clock-names.

Ok, so I've got this wrong, if there is no clk by that name specified
in dt -ENOENT will be returned. Actually -ENOENT is the only
error clk_get and thus devm_clk_get will ever return.

So it seems that clk_get currently is not properly passing along
probe-deferral. To make things future proof I will add a probe
deferral check to the next version of my patch.

Regards,

Hans



More information about the linux-arm-kernel mailing list