summaryrefslogtreecommitdiffstats
path: root/drivers/net/pcs
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2021-06-02 18:20:17 +0200
committerDavid S. Miller <davem@davemloft.net>2021-06-03 22:30:43 +0200
commit679e283ec7d6cfdf997cbb911d6857c115029007 (patch)
tree404e84efc6802dbcfb5952ec322508140e8fece2 /drivers/net/pcs
parentnet: pcs: xpcs: export xpcs_probe (diff)
downloadlinux-679e283ec7d6cfdf997cbb911d6857c115029007.tar.xz
linux-679e283ec7d6cfdf997cbb911d6857c115029007.zip
net: pcs: xpcs: use mdiobus_c45_addr in xpcs_{read,write}
Use the dedicated helper for abstracting away how the clause 45 address is packed in reg_addr. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pcs')
-rw-r--r--drivers/net/pcs/pcs-xpcs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
index 7f51eb4bbaa4..afabb9209c52 100644
--- a/drivers/net/pcs/pcs-xpcs.c
+++ b/drivers/net/pcs/pcs-xpcs.c
@@ -240,14 +240,14 @@ static bool __xpcs_linkmode_supported(const struct xpcs_compat *compat,
static int xpcs_read(struct mdio_xpcs_args *xpcs, int dev, u32 reg)
{
- u32 reg_addr = MII_ADDR_C45 | dev << 16 | reg;
+ u32 reg_addr = mdiobus_c45_addr(dev, reg);
return mdiobus_read(xpcs->bus, xpcs->addr, reg_addr);
}
static int xpcs_write(struct mdio_xpcs_args *xpcs, int dev, u32 reg, u16 val)
{
- u32 reg_addr = MII_ADDR_C45 | dev << 16 | reg;
+ u32 reg_addr = mdiobus_c45_addr(dev, reg);
return mdiobus_write(xpcs->bus, xpcs->addr, reg_addr, val);
}