diff options
| author | Christian Marangi <[email protected]> | 2025-09-20 18:09:43 +0200 |
|---|---|---|
| committer | Jerome Forissier <[email protected]> | 2025-10-22 11:16:10 +0200 |
| commit | ca4264db44c1ece69d208f63c4bfe607c60751d9 (patch) | |
| tree | 402ee4080308bc7c2d3d549c5b9edff3fd79e257 /drivers/net/mtk_eth | |
| parent | 85f3d070e27c3024c6d2c58ecbfd0ecb2343cc0c (diff) | |
net: mediatek: mt7988: free allocated MDIO bus on cleanup
Correctly free the MDIO Bus on calling cleanup function. While at it
also fix a copy-paste error and rename the cleanup function name to the
more specific name.
Signed-off-by: Christian Marangi <[email protected]>
Diffstat (limited to 'drivers/net/mtk_eth')
| -rw-r--r-- | drivers/net/mtk_eth/mt7988.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/mtk_eth/mt7988.c b/drivers/net/mtk_eth/mt7988.c index 06bbe049da3..b77660be55c 100644 --- a/drivers/net/mtk_eth/mt7988.c +++ b/drivers/net/mtk_eth/mt7988.c @@ -142,11 +142,13 @@ static int mt7988_setup(struct mtk_eth_switch_priv *swpriv) return mt7531_mdio_register(priv); } -static int mt7531_cleanup(struct mtk_eth_switch_priv *swpriv) +static int mt7988_cleanup(struct mtk_eth_switch_priv *swpriv) { struct mt753x_switch_priv *priv = (struct mt753x_switch_priv *)swpriv; + struct mii_dev *mdio_bus = priv->mdio_bus; - mdio_unregister(priv->mdio_bus); + mdio_unregister(mdio_bus); + mdio_free(mdio_bus); return 0; } @@ -158,6 +160,6 @@ MTK_ETH_SWITCH(mt7988) = { .reset_wait_time = 50, .setup = mt7988_setup, - .cleanup = mt7531_cleanup, + .cleanup = mt7988_cleanup, .mac_control = mt7988_mac_control, }; |
