public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Quentin Schulz <quentin.schulz@bootlin.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: davem@davemloft.net, f.fainelli@gmail.com,
	allan.nielsen@microchip.com, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, thomas.petazzoni@bootlin.com,
	alexandre.belloni@bootlin.com
Subject: Re: [PATCH net-next v2 1/6] net: phy: mscc: migrate to phy_select/restore_page functions
Date: Thu, 4 Oct 2018 17:57:17 +0200	[thread overview]
Message-ID: <20181004155717.hw6ik4hdlgr4jddw@qschulz> (raw)
In-Reply-To: <20181004151630.GE4730@lunn.ch>

[-- Attachment #1: Type: text/plain, Size: 1144 bytes --]

Hi Andrew,

On Thu, Oct 04, 2018 at 05:16:30PM +0200, Andrew Lunn wrote:
> On Thu, Oct 04, 2018 at 02:47:23PM +0200, Quentin Schulz wrote:
> > @@ -197,25 +199,30 @@ static int vsc85xx_mdix_set(struct phy_device *phydev, u8 mdix)
> >  	if (rc != 0)
> >  		return rc;
> >  
> > -	rc = vsc85xx_phy_page_set(phydev, MSCC_PHY_PAGE_EXTENDED);
> > -	if (rc != 0)
> > -		return rc;
> > +	oldpage = phy_select_page(phydev, MSCC_PHY_PAGE_EXTENDED);
> > +	if (oldpage < 0) {
> > +		rc = oldpage;
> > +		goto out;
> > +	}
> >  
> > -	reg_val = phy_read(phydev, MSCC_PHY_EXT_MODE_CNTL);
> > +	reg_val = __phy_read(phydev, MSCC_PHY_EXT_MODE_CNTL);
> >  	reg_val &= ~(FORCE_MDI_CROSSOVER_MASK);
> >  	if (mdix == ETH_TP_MDI)
> >  		reg_val |= FORCE_MDI_CROSSOVER_MDI;
> >  	else if (mdix == ETH_TP_MDI_X)
> >  		reg_val |= FORCE_MDI_CROSSOVER_MDIX;
> 
> Hi Quentin
> 
> Could you use phy_modify_paged() here? This function only accesses a
> single register, so using the wrapper should not have any
> disadvantages. The same should apply for any function modifying a single
> register.
> 

Sure, will do.

Thanks,
Quentin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-10-04 15:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 12:47 [PATCH net-next v2 0/6] net: phy: mscc: various improvements to Microsemi PHY driver Quentin Schulz
2018-10-04 12:47 ` [PATCH net-next v2 1/6] net: phy: mscc: migrate to phy_select/restore_page functions Quentin Schulz
2018-10-04 15:16   ` Andrew Lunn
2018-10-04 15:57     ` Quentin Schulz [this message]
2018-10-04 12:47 ` [PATCH net-next v2 2/6] net: phy: mscc: add ethtool statistics counters Quentin Schulz
2018-10-04 15:22   ` Andrew Lunn
2018-10-04 12:47 ` [PATCH net-next v2 3/6] net: phy: mscc: Add EEE init sequence Quentin Schulz
2018-10-04 12:47 ` [PATCH net-next v2 4/6] net: phy: mscc: remove unneeded parenthesis Quentin Schulz
2018-10-04 12:47 ` [PATCH net-next v2 5/6] net: phy: mscc: shorten `x != 0` condition to `x` Quentin Schulz
2018-10-04 12:47 ` [PATCH net-next v2 6/6] net: phy: mscc: remove unneeded temporary variable Quentin Schulz

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=20181004155717.hw6ik4hdlgr4jddw@qschulz \
    --to=quentin.schulz@bootlin.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=allan.nielsen@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=thomas.petazzoni@bootlin.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