@@ -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,
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> --- drivers/net/ethernet/atheros/ag71xx.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)