netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viorel Suman <viorel.suman@nxp.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "Viorel Suman (OSS)" <viorel.suman@oss.nxp.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Luo Jie <luoj@codeaurora.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [PATCH] net: phy: at803x: disable WOL at probe
Date: Fri, 27 May 2022 09:50:47 +0000	[thread overview]
Message-ID: <20220527094939.qgtl3s7frlgx3yvf@localhost.localdomain> (raw)
In-Reply-To: <20220526210044.638128f6@kernel.org>

On 22-05-26 21:00:44, Jakub Kicinski wrote:
> On Wed, 25 May 2022 13:36:57 +0300 Viorel Suman (OSS) wrote:
> > diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
> > index 73926006d319..6277d1b1d814 100644
> > --- a/drivers/net/phy/at803x.c
> > +++ b/drivers/net/phy/at803x.c
> > @@ -443,10 +443,10 @@ static int at803x_set_wol(struct phy_device *phydev,
> >  		AT803X_LOC_MAC_ADDR_0_15_OFFSET,
> >  	};
> >  
> > -	if (!ndev)
> > -		return -ENODEV;
> > -
> >  	if (wol->wolopts & WAKE_MAGIC) {
> > +		if (!ndev)
> > +			return -ENODEV;
> 
> Please move the ndev variable into the scope.
> It'll make it clear that it can't be used elsewhere
> in this function.

Thank you for review, done in v2.

> 
> >  		mac = (const u8 *) ndev->dev_addr;
> >  
> >  		if (!is_valid_ether_addr(mac))
> > @@ -857,6 +857,9 @@ static int at803x_probe(struct phy_device *phydev)
> >  	if (phydev->drv->phy_id == ATH8031_PHY_ID) {
> >  		int ccr = phy_read(phydev, AT803X_REG_CHIP_CONFIG);
> >  		int mode_cfg;
> > +		struct ethtool_wolinfo wol = {
> > +			.wolopts = 0,
> > +		};
> >  
> >  		if (ccr < 0)
> >  			goto err;
> > @@ -872,6 +875,13 @@ static int at803x_probe(struct phy_device *phydev)
> >  			priv->is_fiber = true;
> >  			break;
> >  		}
> > +
> > +		/* Disable WOL by default */
> > +		ret = at803x_set_wol(phydev, &wol);
> > +		if (ret < 0) {
> > +			phydev_err(phydev, "failed to disable WOL on probe: %d\n", ret);
> > +			return ret;
> 
> Don't you need to goto err; here?

Missed err section indeed, thanks. Fixed in v2.

> 
> > +		}
> >  	}
> >  
> >  	return 0;

      reply	other threads:[~2022-05-27  9:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25 10:36 [PATCH] net: phy: at803x: disable WOL at probe Viorel Suman (OSS)
2022-05-27  4:00 ` Jakub Kicinski
2022-05-27  9:50   ` Viorel Suman [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=20220527094939.qgtl3s7frlgx3yvf@localhost.localdomain \
    --to=viorel.suman@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=luoj@codeaurora.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=viorel.suman@oss.nxp.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).