diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2023-06-07 12:58:18 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-06-08 19:19:50 -0700 |
commit | d7b6ea1a14e454ae480274a68daed9136409376f (patch) | |
tree | f016982b03ada8e2c1100c5e9e4e4d1a63489120 /drivers | |
parent | 6c79a9c8b1f3eb00b336fc2557fc5e1a5c15bd20 (diff) | |
download | linux-stable-d7b6ea1a14e454ae480274a68daed9136409376f.tar.gz linux-stable-d7b6ea1a14e454ae480274a68daed9136409376f.tar.bz2 linux-stable-d7b6ea1a14e454ae480274a68daed9136409376f.zip |
net: fman_memac: allow lynx PCS to handle 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')
-rw-r--r-- | drivers/net/ethernet/freescale/fman/fman_memac.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index 625c79d5636f..8f45caf4af12 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -976,14 +976,10 @@ static int memac_init(struct fman_mac *memac) static void pcs_put(struct phylink_pcs *pcs) { - struct mdio_device *mdiodev; - if (IS_ERR_OR_NULL(pcs)) return; - mdiodev = lynx_get_mdio_device(pcs); lynx_pcs_destroy(pcs); - mdio_device_free(mdiodev); } static int memac_free(struct fman_mac *memac) @@ -1055,8 +1051,7 @@ static struct phylink_pcs *memac_pcs_create(struct device_node *mac_node, return ERR_PTR(-EPROBE_DEFER); pcs = lynx_pcs_create(mdiodev); - if (!pcs) - mdio_device_free(mdiodev); + mdio_device_put(mdiodev); return pcs; } |