Commit cc20a479 authored by Rosen Penev's avatar Rosen Penev Committed by Jakub Kicinski

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: default avatarRosen Penev <rosenp@gmail.com>
Link: https://patch.msgid.link/20240813170516.7301-4-rosenp@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 8ef34bea
...@@ -1925,7 +1925,7 @@ static int ag71xx_probe(struct platform_device *pdev) ...@@ -1925,7 +1925,7 @@ static int ag71xx_probe(struct platform_device *pdev)
return err; return err;
} }
err = register_netdev(ndev); err = devm_register_netdev(&pdev->dev, ndev);
if (err) { if (err) {
netif_err(ag, probe, ndev, "unable to register net device\n"); netif_err(ag, probe, ndev, "unable to register net device\n");
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
...@@ -1939,17 +1939,6 @@ static int ag71xx_probe(struct platform_device *pdev) ...@@ -1939,17 +1939,6 @@ static int ag71xx_probe(struct platform_device *pdev)
return 0; 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[] = { static const u32 ar71xx_fifo_ar7100[] = {
0x0fff0000, 0x00001fff, 0x00780fff, 0x0fff0000, 0x00001fff, 0x00780fff,
}; };
...@@ -2034,7 +2023,6 @@ static const struct of_device_id ag71xx_match[] = { ...@@ -2034,7 +2023,6 @@ static const struct of_device_id ag71xx_match[] = {
static struct platform_driver ag71xx_driver = { static struct platform_driver ag71xx_driver = {
.probe = ag71xx_probe, .probe = ag71xx_probe,
.remove_new = ag71xx_remove,
.driver = { .driver = {
.name = "ag71xx", .name = "ag71xx",
.of_match_table = ag71xx_match, .of_match_table = ag71xx_match,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment