[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240813170516.7301-4-rosenp@gmail.com>
Date: Tue, 13 Aug 2024 10:04:59 -0700
From: Rosen Penev <rosenp@...il.com>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
linux@...linux.org.uk,
linux-kernel@...r.kernel.org,
o.rempel@...gutronix.de
Subject: [PATCH net-next v2 3/3] net: ag71xx: use devm for register_netdev
Allows completely removing the remove function. Nothing is being done
manually now.
Tested on TP-LINK Archer C7v2.
Signed-off-by: Rosen Penev <rosenp@...il.com>
---
drivers/net/ethernet/atheros/ag71xx.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c
index 3c16f6c5e75c..b74856760be3 100644
--- a/drivers/net/ethernet/atheros/ag71xx.c
+++ b/drivers/net/ethernet/atheros/ag71xx.c
@@ -1917,7 +1917,7 @@ static int ag71xx_probe(struct platform_device *pdev)
return err;
}
- err = register_netdev(ndev);
+ err = devm_register_netdev(&pdev->dev, ndev);
if (err) {
netif_err(ag, probe, ndev, "unable to register net device\n");
platform_set_drvdata(pdev, NULL);
@@ -1931,17 +1931,6 @@ static int ag71xx_probe(struct platform_device *pdev)
return 0;
}
-static void ag71xx_remove(struct platform_device *pdev)
-{
- struct net_device *ndev = platform_get_drvdata(pdev);
-
- if (!ndev)
- return;
-
- unregister_netdev(ndev);
- platform_set_drvdata(pdev, NULL);
-}
-
static const u32 ar71xx_fifo_ar7100[] = {
0x0fff0000, 0x00001fff, 0x00780fff,
};
@@ -2026,7 +2015,6 @@ static const struct of_device_id ag71xx_match[] = {
static struct platform_driver ag71xx_driver = {
.probe = ag71xx_probe,
- .remove_new = ag71xx_remove,
.driver = {
.name = "ag71xx",
.of_match_table = ag71xx_match,
--
2.46.0
Powered by blists - more mailing lists