netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Piotr Raczynski <piotr.raczynski@intel.com>
To: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<kernel@collabora.com>
Subject: Re: [PATCHv1 2/2] net: ethernet: stmmac: dwmac-rk: fix optional phy regulator handling
Date: Fri, 17 Mar 2023 19:16:50 +0100	[thread overview]
Message-ID: <ZBSukvE/EEH5UsTQ@nimitz> (raw)
In-Reply-To: <20230317174243.61500-3-sebastian.reichel@collabora.com>

On Fri, Mar 17, 2023 at 06:42:43PM +0100, Sebastian Reichel wrote:
> The usual devm_regulator_get() call already handles "optional"
> regulators by returning a valid dummy and printing a warning
> that the dummy regulator should be described properly. This
> code open coded the same behaviour, but masked any errors that
> are not -EPROBE_DEFER and is quite noisy.
> 
> This change effectively unmasks and propagates regulators errors
> not involving -ENODEV, downgrades the error print to warning level
> if no regulator is specified and captures the probe defer message
> for /sys/kernel/debug/devices_deferred.

Code looks fine, however this seems like a fix, then Fixes tag would
be nice. Also target tree (net?) should be specified.

> 
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
> index 126812cd17e6..01de0174fa18 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
> @@ -1680,14 +1680,11 @@ static struct rk_priv_data *rk_gmac_setup(struct platform_device *pdev,
>  		}
>  	}
>  
> -	bsp_priv->regulator = devm_regulator_get_optional(dev, "phy");
> +	bsp_priv->regulator = devm_regulator_get(dev, "phy");
>  	if (IS_ERR(bsp_priv->regulator)) {
> -		if (PTR_ERR(bsp_priv->regulator) == -EPROBE_DEFER) {
> -			dev_err(dev, "phy regulator is not available yet, deferred probing\n");
> -			return ERR_PTR(-EPROBE_DEFER);
> -		}
> -		dev_err(dev, "no regulator found\n");
> -		bsp_priv->regulator = NULL;
> +		ret = PTR_ERR(bsp_priv->regulator);
> +		dev_err_probe(dev, ret, "failed to get phy regulator\n");
> +		return ERR_PTR(ret);
>  	}
>  
>  	ret = of_property_read_string(dev->of_node, "clock_in_out", &strings);
> -- 
> 2.39.2
> 

  reply	other threads:[~2023-03-17 18:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17 17:42 [PATCHv1 0/2] Fix RK3588 error prints Sebastian Reichel
2023-03-17 17:42 ` [PATCHv1 1/2] net: ethernet: stmmac: dwmac-rk: fix optional clock handling Sebastian Reichel
2023-03-17 18:24   ` Piotr Raczynski
2023-03-17 20:04     ` Sebastian Reichel
2023-03-22  3:10   ` Jakub Kicinski
2023-03-17 17:42 ` [PATCHv1 2/2] net: ethernet: stmmac: dwmac-rk: fix optional phy regulator handling Sebastian Reichel
2023-03-17 18:16   ` Piotr Raczynski [this message]
2023-03-17 20:12     ` Sebastian Reichel

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=ZBSukvE/EEH5UsTQ@nimitz \
    --to=piotr.raczynski@intel.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=joabreu@synopsys.com \
    --cc=kernel@collabora.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    --cc=sebastian.reichel@collabora.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).