net: phy: marvell: #defines for copper and fibre pages

Replace magic numbers for PHY pages with symbolic names.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Andrew Lunn 2017-05-25 21:42:05 +02:00 committed by David S. Miller
parent a55667e6f2
commit 3ea17bc7bc
1 changed files with 11 additions and 11 deletions

View File

@ -650,7 +650,7 @@ static int m88e1116r_config_init(struct phy_device *phydev)
mdelay(500); mdelay(500);
err = marvell_set_page(phydev, 0); err = marvell_set_page(phydev, MII_M1111_COPPER);
if (err < 0) if (err < 0)
return err; return err;
@ -662,7 +662,7 @@ static int m88e1116r_config_init(struct phy_device *phydev)
if (err < 0) if (err < 0)
return err; return err;
err = marvell_set_page(phydev, 2); err = marvell_set_page(phydev, MII_88E1121_PHY_MSCR_PAGE);
if (err < 0) if (err < 0)
return err; return err;
temp = phy_read(phydev, MII_M1116R_CONTROL_REG_MAC); temp = phy_read(phydev, MII_M1116R_CONTROL_REG_MAC);
@ -671,7 +671,7 @@ static int m88e1116r_config_init(struct phy_device *phydev)
err = phy_write(phydev, MII_M1116R_CONTROL_REG_MAC, temp); err = phy_write(phydev, MII_M1116R_CONTROL_REG_MAC, temp);
if (err < 0) if (err < 0)
return err; return err;
err = marvell_set_page(phydev, 0); err = marvell_set_page(phydev, MII_M1111_COPPER);
if (err < 0) if (err < 0)
return err; return err;
@ -892,7 +892,7 @@ static int m88e1510_config_init(struct phy_device *phydev)
return err; return err;
/* Reset page selection */ /* Reset page selection */
err = marvell_set_page(phydev, 0); err = marvell_set_page(phydev, MII_M1111_COPPER);
if (err < 0) if (err < 0)
return err; return err;
} }
@ -922,7 +922,7 @@ static int m88e1118_config_init(struct phy_device *phydev)
int err; int err;
/* Change address */ /* Change address */
err = marvell_set_page(phydev, 2); err = marvell_set_page(phydev, MII_88E1121_PHY_MSCR_PAGE);
if (err < 0) if (err < 0)
return err; return err;
@ -932,7 +932,7 @@ static int m88e1118_config_init(struct phy_device *phydev)
return err; return err;
/* Change address */ /* Change address */
err = marvell_set_page(phydev, 3); err = marvell_set_page(phydev, MII_88E1318S_PHY_LED_PAGE);
if (err < 0) if (err < 0)
return err; return err;
@ -949,7 +949,7 @@ static int m88e1118_config_init(struct phy_device *phydev)
return err; return err;
/* Reset address */ /* Reset address */
err = marvell_set_page(phydev, 0); err = marvell_set_page(phydev, MII_M1111_COPPER);
if (err < 0) if (err < 0)
return err; return err;
@ -961,7 +961,7 @@ static int m88e1149_config_init(struct phy_device *phydev)
int err; int err;
/* Change address */ /* Change address */
err = marvell_set_page(phydev, 2); err = marvell_set_page(phydev, MII_88E1121_PHY_MSCR_PAGE);
if (err < 0) if (err < 0)
return err; return err;
@ -975,7 +975,7 @@ static int m88e1149_config_init(struct phy_device *phydev)
return err; return err;
/* Reset address */ /* Reset address */
err = marvell_set_page(phydev, 0); err = marvell_set_page(phydev, MII_M1111_COPPER);
if (err < 0) if (err < 0)
return err; return err;
@ -1409,7 +1409,7 @@ static void m88e1318_get_wol(struct phy_device *phydev,
MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE) MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE)
wol->wolopts |= WAKE_MAGIC; wol->wolopts |= WAKE_MAGIC;
if (marvell_set_page(phydev, 0x00) < 0) if (marvell_set_page(phydev, MII_M1111_COPPER) < 0)
return; return;
} }
@ -1422,7 +1422,7 @@ static int m88e1318_set_wol(struct phy_device *phydev,
if (wol->wolopts & WAKE_MAGIC) { if (wol->wolopts & WAKE_MAGIC) {
/* Explicitly switch to page 0x00, just to be sure */ /* Explicitly switch to page 0x00, just to be sure */
err = marvell_set_page(phydev, 0x00); err = marvell_set_page(phydev, MII_M1111_COPPER);
if (err < 0) if (err < 0)
return err; return err;