Subject: Re: [PATCH net-next v4 3/3] net: lan743x: Return PTR_ERR() for fixed_phy_register()

From: Jakub Kicinski <[email-masked]>
Date: Wed, 23 Aug 2023 07:37:43 -0700

On Wed, 23 Aug 2023 15:43:58 +0800 Ruan Jinjie wrote:
> > EPROBE_DEFER is not a unix error code. We can't return it to user
> > space, so propagating it from ndo_open is not correct.  
> 
> When the error is EPROBE_DEFER, Whether print the netdev_err is ok? And
> what should it return?
> 
> How about this?
> 
> if (IS_ERR(phydev)) {
>      ......
>      if (PTR_ERR(phydev) != -EPROBE_DEFER)
>          return PTR_ERR(phydev);
>      else
>          return -EIO;
> }

That's too much code to copy & paste into every driver.

Someone who understands the code flow very well should tackle this.
Please leave the cases where fixed_phy_register() is called outside 
of probe alone.