Thread (7 messages) 7 messages, 2 authors, 2023-08-23

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

flat view

From: Jakub Kicinski <kuba@kernel.org>
Date: 2023-08-23 14:37:45

On Wed, 23 Aug 2023 15:43:58 +0800 Ruan Jinjie wrote:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help