Commit 85a2b4ac authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Jakub Kicinski

net: pcs: xpcs: use mdiodev accessors

Use mdiodev accessors rather than accessing the bus and address in
the mdio_device structure and using the mdiobus accessors.
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent f6479ea4
...@@ -188,18 +188,12 @@ static bool __xpcs_linkmode_supported(const struct xpcs_compat *compat, ...@@ -188,18 +188,12 @@ static bool __xpcs_linkmode_supported(const struct xpcs_compat *compat,
int xpcs_read(struct dw_xpcs *xpcs, int dev, u32 reg) int xpcs_read(struct dw_xpcs *xpcs, int dev, u32 reg)
{ {
struct mii_bus *bus = xpcs->mdiodev->bus; return mdiodev_c45_read(xpcs->mdiodev, dev, reg);
int addr = xpcs->mdiodev->addr;
return mdiobus_c45_read(bus, addr, dev, reg);
} }
int xpcs_write(struct dw_xpcs *xpcs, int dev, u32 reg, u16 val) int xpcs_write(struct dw_xpcs *xpcs, int dev, u32 reg, u16 val)
{ {
struct mii_bus *bus = xpcs->mdiodev->bus; return mdiodev_c45_write(xpcs->mdiodev, dev, reg, val);
int addr = xpcs->mdiodev->addr;
return mdiobus_c45_write(bus, addr, dev, reg, val);
} }
static int xpcs_modify_changed(struct dw_xpcs *xpcs, int dev, u32 reg, static int xpcs_modify_changed(struct dw_xpcs *xpcs, int dev, u32 reg,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment