Skip to content

Commit

Permalink
net: pcs: xpcs: use mdiobus_c45_addr in xpcs_{read,write}
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vladimir Oltean authored and David S. Miller committed Jun 3, 2021
1 parent 8e2bb95 commit 679e283
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/pcs/pcs-xpcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 679e283

Please sign in to comment.