aboutsummaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorMichael Walle2022-05-31 18:36:16 +0200
committerTom Rini2022-06-03 11:15:24 -0400
commit7704b7fd673a603805f5ddd8807f69d4bc3b9188 (patch)
tree3fc55c5d245d70fb5868ae3474f64abf9dc4058e /drivers/net
parent339f652992919be11e3f1b791515140de646a3ef (diff)
net: enetc: unregister mdiobus
If the device fails to probe - for example, when there is no ethaddr set - then the private data is automatically freed but the mdiobus remains registered. Fixes: 1e354cb39314 ("drivers: net: fsl_enetc: register internal MDIO bus") Signed-off-by: Michael Walle <michael@walle.cc>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/fsl_enetc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/fsl_enetc.c b/drivers/net/fsl_enetc.c
index 9b97a03ccb3..cd4c2c29a65 100644
--- a/drivers/net/fsl_enetc.c
+++ b/drivers/net/fsl_enetc.c
@@ -361,6 +361,9 @@ static int enetc_remove(struct udevice *dev)
{
struct enetc_priv *priv = dev_get_priv(dev);
+ if (miiphy_get_dev_by_name(priv->imdio.name))
+ mdio_unregister(&priv->imdio);
+
free(priv->enetc_txbd);
free(priv->enetc_rxbd);