netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Ruan Jinjie <ruanjinjie@huawei.com>
Cc: <rafal@milecki.pl>, <bcm-kernel-feedback-list@broadcom.com>,
	<davem@davemloft.net>, <edumazet@google.com>, <pabeni@redhat.com>,
	<opendmb@gmail.com>, <florian.fainelli@broadcom.com>,
	<bryan.whitehead@microchip.com>, <UNGLinuxDriver@microchip.com>,
	<netdev@vger.kernel.org>, <andrew@lunn.ch>
Subject: Re: [PATCH net-next v4 3/3] net: lan743x: Return PTR_ERR() for fixed_phy_register()
Date: Wed, 23 Aug 2023 07:37:43 -0700	[thread overview]
Message-ID: <20230823073743.61770fa4@kernel.org> (raw)
In-Reply-To: <2763f37a-8707-7fad-5dd4-cc4247fe3e1b@huawei.com>

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.

      reply	other threads:[~2023-08-23 14:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-21  2:50 [PATCH net-next v4 0/3] net: Return PTR_ERR() for fixed_phy_register() Jinjie Ruan
2023-08-21  2:50 ` [PATCH net-next v4 1/3] net: bgmac: " Jinjie Ruan
2023-08-21  2:50 ` [PATCH net-next v4 2/3] net: bcmgenet: " Jinjie Ruan
2023-08-21  2:50 ` [PATCH net-next v4 3/3] net: lan743x: " Jinjie Ruan
2023-08-23  0:03   ` Jakub Kicinski
2023-08-23  7:43     ` Ruan Jinjie
2023-08-23 14:37       ` Jakub Kicinski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230823073743.61770fa4@kernel.org \
    --to=kuba@kernel.org \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bryan.whitehead@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=opendmb@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=rafal@milecki.pl \
    --cc=ruanjinjie@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).