[PATCH 2/4] phy: propagate error in of_phy_get_by_phandle

Johannes Zink j.zink at pengutronix.de
Thu Jul 7 07:39:51 PDT 2022


On Wed, 2022-07-06 at 16:21 +0200, Marco Felsch wrote:
> Don't return -ENODEV if of_phy_provider_lookup() fails instead
> propagate
> the error. So errors like -EPROBE_DEFER are propagated correctly.
> 
> Signed-off-by: Marco Felsch <m.felsch at pengutronix.de>
> ---
>  drivers/phy/phy-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index ef7bd76648..8a57bd1aa9 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -317,7 +317,7 @@ struct phy *of_phy_get_by_phandle(struct device_d
> *dev, const char *phandle,
>  
>         phy_provider = of_phy_provider_lookup(np);
>         if (IS_ERR(phy_provider)) {
> -               return ERR_PTR(-ENODEV);
> +               return ERR_CAST(phy_provider);
>         }
>  
>         return phy_provider->of_xlate(phy_provider->dev, NULL);

Tested-by: Johannes Zink <j.zink at pengutronix.de> # i.MX7




More information about the barebox mailing list