[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241202212331.7238-8-rosenp@gmail.com>
Date: Mon, 2 Dec 2024 13:23:27 -0800
From: Rosen Penev <rosenp@...il.com>
To: netdev@...r.kernel.org
Cc: Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Claudiu Manoil <claudiu.manoil@....com>,
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH net-next 07/11] net: gianfar: use devm for register_netdev
Avoid manual unregister of netdev.
Signed-off-by: Rosen Penev <rosenp@...il.com>
---
drivers/net/ethernet/freescale/gianfar.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index e486b77bc6f4..9ff756130ba8 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -3305,7 +3305,7 @@ static int gfar_probe(struct platform_device *ofdev)
/* Carrier starts down, phylib will bring it up */
netif_carrier_off(dev);
- err = register_netdev(dev);
+ err = devm_register_netdev(&ofdev->dev, dev);
if (err) {
pr_err("%s: Cannot register net device, aborting\n", dev->name);
@@ -3374,8 +3374,6 @@ static void gfar_remove(struct platform_device *ofdev)
of_node_put(priv->phy_node);
of_node_put(priv->tbi_node);
- unregister_netdev(priv->ndev);
-
if (of_phy_is_fixed_link(np))
of_phy_deregister_fixed_link(np);
--
2.47.0
Powered by blists - more mailing lists