mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
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>
This commit is contained in:
parent
c8cc2ae229
commit
6c79a9c8b1
1 changed files with 1 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue