Re: [PATCH net-next v2 1/6] net: phy: mscc: migrate to phy_select/restore_page functions
From: Quentin Schulz
Date: Thu Oct 04 2018 - 11:57:33 EST
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:
signature.asc
Description: PGP signature