summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/freescale
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2023-06-07 13:58:13 +0200
committerJakub Kicinski <kuba@kernel.org>2023-06-09 04:19:50 +0200
commit6c79a9c8b1f3eb00b336fc2557fc5e1a5c15bd20 (patch)
tree6aadcdb1191528e5e8bcf246d3f03fe9c90fb0bd /drivers/net/ethernet/freescale
parentnet: pch_gbe: Allow build on MIPS_GENERIC kernel (diff)
downloadlinux-6c79a9c8b1f3eb00b336fc2557fc5e1a5c15bd20.tar.xz
linux-6c79a9c8b1f3eb00b336fc2557fc5e1a5c15bd20.zip
net: dpaa2-mac: allow lynx PCS to manage mdiodev lifetime
Put the mdiodev after lynx_pcs_create() so that the Lynx PCS driver can manage the lifetime of the mdiodev its using. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r--drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
index cb70855e2b9a..c0f7dd3b4ac1 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
@@ -271,9 +271,9 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac,
}
mac->pcs = lynx_pcs_create(mdiodev);
+ mdio_device_put(mdiodev);
if (!mac->pcs) {
netdev_err(mac->net_dev, "lynx_pcs_create() failed\n");
- mdio_device_free(mdiodev);
return -ENOMEM;
}
@@ -285,10 +285,7 @@ static void dpaa2_pcs_destroy(struct dpaa2_mac *mac)
struct phylink_pcs *phylink_pcs = mac->pcs;
if (phylink_pcs) {
- struct mdio_device *mdio = lynx_get_mdio_device(phylink_pcs);
-
lynx_pcs_destroy(phylink_pcs);
- mdio_device_free(mdio);
mac->pcs = NULL;
}
}