[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181004155717.hw6ik4hdlgr4jddw@qschulz>
Date: Thu, 4 Oct 2018 17:57:17 +0200
From: Quentin Schulz <quentin.schulz@...tlin.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: davem@...emloft.net, f.fainelli@...il.com,
allan.nielsen@...rochip.com, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, thomas.petazzoni@...tlin.com,
alexandre.belloni@...tlin.com
Subject: Re: [PATCH net-next v2 1/6] net: phy: mscc: migrate to
phy_select/restore_page functions
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
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists