]> git.baikalelectronics.ru Git - kernel.git/commitdiff
r8169: improve rtl_remove_one
authorHeiner Kallweit <hkallweit1@gmail.com>
Mon, 25 May 2020 19:54:00 +0000 (21:54 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 May 2020 03:27:18 +0000 (20:27 -0700)
Don't call netif_napi_del() manually, free_netdev() does this for us.
In addition reorder calls to match reverse order of calls in probe().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/realtek/r8169_main.c

index 17c564457e52e863c0260046618362529a4169d6..d672ae77c644824eba0d6d399db4d31f5990585e 100644 (file)
@@ -4996,17 +4996,15 @@ static void rtl_remove_one(struct pci_dev *pdev)
        struct net_device *dev = pci_get_drvdata(pdev);
        struct rtl8169_private *tp = netdev_priv(dev);
 
-       if (r8168_check_dash(tp))
-               rtl8168_driver_stop(tp);
-
-       netif_napi_del(&tp->napi);
+       if (pci_dev_run_wake(pdev))
+               pm_runtime_get_noresume(&pdev->dev);
 
        unregister_netdev(dev);
 
-       rtl_release_firmware(tp);
+       if (r8168_check_dash(tp))
+               rtl8168_driver_stop(tp);
 
-       if (pci_dev_run_wake(pdev))
-               pm_runtime_get_noresume(&pdev->dev);
+       rtl_release_firmware(tp);
 
        /* restore original MAC address */
        rtl_rar_set(tp, dev->perm_addr);