[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <13536518-bb67-795a-e385-fe34deec78d1@gmail.com>
Date: Mon, 25 May 2020 21:54:00 +0200
From: Heiner Kallweit <hkallweit1@...il.com>
To: Realtek linux nic maintainers <nic_swsd@...ltek.com>,
David Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: [PATCH net-next] r8169: improve rtl_remove_one
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@...il.com>
---
drivers/net/ethernet/realtek/r8169_main.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 17c564457..d672ae77c 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -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);
--
2.26.2
Powered by blists - more mailing lists