The switch implements a generic MDIO bus, which could host more than
PHYs. It is conventional to use _mdio_ or _mii_ in the function name,
so rename them. Also postfix make the historically first read/write
function with _direct, to help distinguish it from _indirect and _ppu.
While touching these functions, remove some of the _ prefixes, which
we are deprecating.
Signed-off-by: Andrew Lunn
---
drivers/net/dsa/mv88e6xxx.c | 126 ++--
1 file changed, 63 insertions(+), 63 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index 11845eccf670..b8e65e604f75 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -238,16 +238,16 @@ int mv88e6xxx_set_addr(struct dsa_switch *ds, u8 *addr)
return mv88e6xxx_set_addr_direct(ds, addr);
}
-static int _mv88e6xxx_phy_read(struct mv88e6xxx_priv_state *ps, int addr,
- int regnum)
+static int mv88e6xxx_mdio_read_direct(struct mv88e6xxx_priv_state *ps,
+ int addr, int regnum)
{
if (addr >= 0)
return _mv88e6xxx_reg_read(ps, addr, regnum);
return 0x;
}
-static int _mv88e6xxx_phy_write(struct mv88e6xxx_priv_state *ps, int addr,
- int regnum, u16 val)
+static int mv88e6xxx_mdio_write_direct(struct mv88e6xxx_priv_state *ps,
+ int addr, int regnum, u16 val)
{
if (addr >= 0)
return _mv88e6xxx_reg_write(ps, addr, regnum, val);
@@ -378,8 +378,8 @@ void mv88e6xxx_ppu_state_init(struct mv88e6xxx_priv_state
*ps)
ps->ppu_timer.function = mv88e6xxx_ppu_reenable_timer;
}
-static int mv88e6xxx_phy_read_ppu(struct mv88e6xxx_priv_state *ps, int addr,
- int regnum)
+static int mv88e6xxx_mdio_read_ppu(struct mv88e6xxx_priv_state *ps, int addr,
+ int regnum)
{
int ret;
@@ -392,8 +392,8 @@ static int mv88e6xxx_phy_read_ppu(struct
mv88e6xxx_priv_state *ps, int addr,
return ret;
}
-static int mv88e6xxx_phy_write_ppu(struct mv88e6xxx_priv_state *ps, int addr,
- int regnum, u16 val)
+static int mv88e6xxx_mdio_write_ppu(struct mv88e6xxx_priv_state *ps, int addr,
+ int regnum, u16 val)
{
int ret;
@@ -829,7 +829,7 @@ static int mv88e6xxx_wait(struct mv88e6xxx_priv_state *ps,
int reg,
return ret;
}
-static int _mv88e6xxx_phy_wait(struct mv88e6xxx_priv_state *ps)
+static int mv88e6xxx_mdio_wait(struct mv88e6xxx_priv_state *ps)
{
return _mv88e6xxx_wait(ps, REG_GLOBAL2, GLOBAL2_SMI_OP,
GLOBAL2_SMI_OP_BUSY);
@@ -1076,7 +1076,7 @@ static int _mv88e6xxx_atu_wait(struct
mv88e6xxx_priv_state *ps)
GLOBAL_ATU_OP_BUSY);
}
-static int _mv88e6xxx_phy_read_indirect(struct mv88e6xxx_priv_state *ps,
+static int mv88e6xxx_mdio_read_indirect(struct mv88e6xxx_priv_state *ps,
int addr, int regnum)
{
int ret;
@@ -1087,7 +1087,7 @@ static int _mv88e6xxx_phy_read_indirect(struct
mv88e6xxx_priv_state *ps,
if (ret < 0)
return ret;
- ret = _mv88e6xxx_phy_wait(ps);
+ ret = mv88e6xxx_mdio_wait(ps);
if (ret < 0)
return ret;
@@ -1096,7 +1096,7 @@ static int _mv88e6xxx_phy_read_indirect(struct
mv88e6xxx_priv_state *ps,
return ret;
}
-static int _mv88e6xxx_phy_write_indirect(struct mv88e6xxx_priv_state *ps,
+static int mv88e6xxx_mdio_write_indirect(struct mv88e6xxx_priv_state *ps,
int addr, int regnum, u16 val)
{
int ret;
@@ -1109,7 +1109,7 @@ static int _mv88e6xxx_phy_write_indirect(struct
mv88e6xxx_priv_state *ps,
GLOBAL2_SMI_OP_22_WRITE | (addr << 5) |
regnum);
- return _mv88e6xxx_phy_wait(ps);
+ return mv88e6xxx_mdio_wait(ps);
}
static int mv88e6xxx_get_eee(struct dsa_switch *ds, int port,
@@ -1123,7 +1123,7 @@ static int mv88e6xxx_get_eee(struct dsa_switch *ds, int
port,
mutex_lock(>smi_mutex);
- reg = _mv88e6xxx_phy_read_indirect(ps, port, 16);
+ reg = mv88e6xxx_mdio_read_indirect(ps, port, 16);
if (reg < 0)
goto out;
@@ -1154,7 +1154,7 @@ static int mv88e6xxx_set_eee(struct dsa_switch *ds, int
port,
mutex_lock(>smi_mutex);
- ret = _mv88e6xxx_phy_read_indirect(ps, port, 16);
+ ret = mv88e6xxx_mdio_read_indirect(ps, port, 16);
if (ret < 0)
goto out;
@@ -1164,7 +1164,7 @@ static int mv88e6xxx_set_eee(struct dsa_switch *ds, int
port,
if (e->tx_lpi_enabled)
reg |= 0x0100;
- ret = _mv88e6xxx_phy_write_indirect(ps, port, 16, reg);
+ ret =