diff mbox series

[net-next] net: dpaa2-mac: use correct interface to free mdiodev

Message ID E1q2VsB-008QlZ-El@rmk-PC.armlinux.org.uk (mailing list archive)
State Accepted
Commit 404621fab27310c231bab9a3999eab858390cb45
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: dpaa2-mac: use correct interface to free mdiodev | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 19 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Russell King (Oracle) May 26, 2023, 11:44 a.m. UTC
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: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
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(-)

Comments

Simon Horman May 27, 2023, 12:07 p.m. UTC | #1
On Fri, May 26, 2023 at 12:44:43PM +0100, Russell King (Oracle) wrote:
> 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: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
> 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.

Reviewed-by: Simon Horman <simon.horman@corigine.com>
Ioana Ciornei May 29, 2023, 5:09 p.m. UTC | #2
On Fri, May 26, 2023 at 12:44:43PM +0100, Russell King (Oracle) wrote:
> 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: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com
Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com
patchwork-bot+netdevbpf@kernel.org May 30, 2023, 5 a.m. UTC | #3
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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().
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
> 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!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
index b1871e6c4006..cb70855e2b9a 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
@@ -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;
 	}
 }