Commit 404621fa authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by Jakub Kicinski

net: dpaa2-mac: use correct interface to free mdiodev

Rather than using put_device(&mdiodev->dev), use the proper interface
provided to dispose of the mdiodev - that being mdio_device_free().
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Reviewed-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
Tested-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/E1q2VsB-008QlZ-El@rmk-PC.armlinux.org.ukSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 3ed018fb
...@@ -273,7 +273,7 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac, ...@@ -273,7 +273,7 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac,
mac->pcs = lynx_pcs_create(mdiodev); mac->pcs = lynx_pcs_create(mdiodev);
if (!mac->pcs) { if (!mac->pcs) {
netdev_err(mac->net_dev, "lynx_pcs_create() failed\n"); netdev_err(mac->net_dev, "lynx_pcs_create() failed\n");
put_device(&mdiodev->dev); mdio_device_free(mdiodev);
return -ENOMEM; return -ENOMEM;
} }
...@@ -286,10 +286,9 @@ static void dpaa2_pcs_destroy(struct dpaa2_mac *mac) ...@@ -286,10 +286,9 @@ static void dpaa2_pcs_destroy(struct dpaa2_mac *mac)
if (phylink_pcs) { if (phylink_pcs) {
struct mdio_device *mdio = lynx_get_mdio_device(phylink_pcs); struct mdio_device *mdio = lynx_get_mdio_device(phylink_pcs);
struct device *dev = &mdio->dev;
lynx_pcs_destroy(phylink_pcs); lynx_pcs_destroy(phylink_pcs);
put_device(dev); mdio_device_free(mdio);
mac->pcs = NULL; mac->pcs = NULL;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment