diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2020-05-26 17:29:36 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-27 00:31:45 +0200 |
commit | 90ce665c6a40dc1be771bf5f86e624c0acf3a76f (patch) | |
tree | 2a47bbd8f8eeef4638694115ca06e66bda2c0da4 /drivers/net/phy/bcm87xx.c | |
parent | Merge branch 'flow-mpls' (diff) | |
download | linux-90ce665c6a40dc1be771bf5f86e624c0acf3a76f.tar.xz linux-90ce665c6a40dc1be771bf5f86e624c0acf3a76f.zip |
net: mdiobus: add clause 45 mdiobus accessors
There is a recurring pattern throughout some of the PHY code converting
a devad and regnum to our packed clause 45 representation. Rather than
having this scattered around the code, let's put a common translation
function in mdio.h, and provide some register accessors.
Convert the phylib core, phylink, bcm87xx and cortina to use these.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/bcm87xx.c')
-rw-r--r-- | drivers/net/phy/bcm87xx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/phy/bcm87xx.c b/drivers/net/phy/bcm87xx.c index f6dce6850850..df360e1c5069 100644 --- a/drivers/net/phy/bcm87xx.c +++ b/drivers/net/phy/bcm87xx.c @@ -55,7 +55,7 @@ static int bcm87xx_of_reg_init(struct phy_device *phydev) u16 mask = be32_to_cpup(paddr++); u16 val_bits = be32_to_cpup(paddr++); int val; - u32 regnum = MII_ADDR_C45 | (devid << 16) | reg; + u32 regnum = mdiobus_c45_addr(devid, reg); val = 0; if (mask) { val = phy_read(phydev, regnum); |