mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 23:20:32 -04:00
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@gmail.com> Link: https://patch.msgid.link/20240813170516.7301-4-rosenp@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
8ef34bea8c
commit
cc20a47916
@@ -1925,7 +1925,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);
|
||||
@@ -1939,17 +1939,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,
|
||||
};
|
||||
@@ -2034,7 +2023,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,
|
||||
|
||||
Reference in New Issue
Block a user