Skip to contentSkip to conversation

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

PATCH Applied Russell King (Oracle) 4 participants 4 messages May 26, 2023 – May 30, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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().

---
This change is independent of the series I posted changing the lynx PCS - since we're only subsituting an explicit put_device() for the right interface in this driver, and this driver is not touched by that series.

 drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c +2 -3
index b1871e6c4006..cb70855e2b9a 100644
@@ -273,7 +273,7 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac,
 	mac->pcs = lynx_pcs_create(mdiodev);
 	if (!mac->pcs) {
 		netdev_err(mac->net_dev, "lynx_pcs_create() failed\n");
-		put_device(&mdiodev->dev);
+		mdio_device_free(mdiodev);
 		return -ENOMEM;
 	}
 
@@ -286,10 +286,9 @@ static void dpaa2_pcs_destroy(struct dpaa2_mac *mac)
 
 	if (phylink_pcs) {
 		struct mdio_device *mdio = lynx_get_mdio_device(phylink_pcs);
-		struct device *dev = &mdio->dev;
 
 		lynx_pcs_destroy(phylink_pcs);
-		put_device(dev);
+		mdio_device_free(mdio);
 		mac->pcs = NULL;
 	}
 }
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Russell King (Oracle)

Rather than using put_device(&mdiodev->dev), use the proper interface provided to dispose of the mdiodev - that being mdio_device_free().

---
This change is independent of the series I posted changing the lynx PCS - since we're only subsituting an explicit put_device() for the right interface in this driver, and this driver is not touched by that series.

#3 lore raw
In reply to Russell King (Oracle)
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 11 lines · On Fri, 26 May 2023 12:44:43 +0100 you wrote:

Rather than using put_device(&mdiodev->dev), use the proper interface provided to dispose of the mdiodev - that being mdio_device_free().

---
This change is independent of the series I posted changing the lynx PCS - since we're only subsituting an explicit put_device() for the right interface in this driver, and this driver is not touched by that series.

[...]

Here is the summary with links:
- [net-next] net: dpaa2-mac: use correct interface to free mdiodev

    https://git.kernel.org/netdev/net-next/c/404621fab273

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html