summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <[email protected]>2025-03-02 02:24:49 +0100
committerMarek Vasut <[email protected]>2025-03-11 23:05:57 +0100
commitf6fba8385745b560678c02997d8fe448c1679ca5 (patch)
treed0aa91eb3b9440cb311b8d5c9cc90d2204ec40c3
parent877e29cfb1a72d929e79a66281228010d330c7f5 (diff)
net: sh_eth: Switch back to mdio_alloc()
Use mdio_alloc() again to allocate MDIO bus. This is possible because all the miiphybb parameters and ops passing is handled in at bb_miiphy_read()/bb_miiphy_write() level. This also fixes previously missed bb_miiphy_free() in .remove callback of this driver. which does not pose a problem anymore. Fixes: 08eefb5e792d ("net: sh_eth: Allocate bb_miiphy using bb_miiphy_alloc() and fill in callbacks") Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Paul Barker <[email protected]>
-rw-r--r--drivers/net/sh_eth.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index c2e2f3fc6c6..f695a3a41d2 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -739,7 +739,6 @@ static int sh_ether_probe(struct udevice *udev)
struct eth_pdata *pdata = dev_get_plat(udev);
struct sh_ether_priv *priv = dev_get_priv(udev);
struct sh_eth_dev *eth = &priv->shdev;
- struct bb_miiphy_bus *bb_miiphy;
struct mii_dev *mdiodev;
int ret;
@@ -750,14 +749,12 @@ static int sh_ether_probe(struct udevice *udev)
if (ret < 0)
return ret;
#endif
- bb_miiphy = bb_miiphy_alloc();
- if (!bb_miiphy) {
+ mdiodev = mdio_alloc();
+ if (!mdiodev) {
ret = -ENOMEM;
return ret;
}
- mdiodev = &bb_miiphy->mii;
-
mdiodev->read = sh_eth_bb_miiphy_read;
mdiodev->write = sh_eth_bb_miiphy_write;
mdiodev->priv = eth;
@@ -767,7 +764,7 @@ static int sh_ether_probe(struct udevice *udev)
if (ret < 0)
goto err_mdio_register;
- priv->bus = &bb_miiphy->mii;
+ priv->bus = mdiodev;
eth->port = CFG_SH_ETHER_USE_PORT;
eth->port_info[eth->port].phy_addr = CFG_SH_ETHER_PHY_ADDR;
@@ -797,7 +794,7 @@ err_phy_config:
clk_disable(&priv->clk);
#endif
err_mdio_register:
- bb_miiphy_free(bb_miiphy);
+ mdio_free(mdiodev);
return ret;
}