mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
net: dsa: microchip: call DSA's phy_{read/write} to do mdio {read/write}
ksz_sw_mdio_read() and ksz_sw_mdio_write() respectively call ksz_dev_ops::phy_r() and ksz_dev_ops::phy_w() just like dsa_switch_ops::phy_read() and dsa_switch_ops::phy_write() do. Call dsa_switch_ops::phy_read() from ksz_sw_mdio_read() and dsa_switch_ops::phy_write() from ksz_sw_mdio_write() so we'll be able to get rid of the useless indirections provided by ksz_dev_ops in upcoming patch. Signed-off-by: Bastien Curutchet (Schneider Electric) <bastien.curutchet@bootlin.com> Link: https://patch.msgid.link/20260521-clean-ksz-2nd-series-v3-7-75c38971c19a@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
aa69020989
commit
932fc72b98
|
|
@ -2260,22 +2260,18 @@ static void ksz_update_port_member(struct ksz_device *dev, int port)
|
|||
static int ksz_sw_mdio_read(struct mii_bus *bus, int addr, int regnum)
|
||||
{
|
||||
struct ksz_device *dev = bus->priv;
|
||||
u16 val;
|
||||
int ret;
|
||||
struct dsa_switch *ds = dev->ds;
|
||||
|
||||
ret = dev->dev_ops->r_phy(dev, addr, regnum, &val);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return val;
|
||||
return ds->ops->phy_read(ds, addr, regnum);
|
||||
}
|
||||
|
||||
static int ksz_sw_mdio_write(struct mii_bus *bus, int addr, int regnum,
|
||||
u16 val)
|
||||
{
|
||||
struct ksz_device *dev = bus->priv;
|
||||
struct dsa_switch *ds = dev->ds;
|
||||
|
||||
return dev->dev_ops->w_phy(dev, addr, regnum, val);
|
||||
return ds->ops->phy_write(ds, addr, regnum, val);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user