aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/realtek/r8169.c
diff options
context:
space:
mode:
authorFrancois Romieu <romieu@fr.zoreil.com>2012-03-08 03:54:01 -0500
committerFrancois Romieu <romieu@fr.zoreil.com>2012-03-10 16:38:13 -0500
commite27566ed370da09e3b812d3d76dce002915a5bdd (patch)
treeefc99859c92b0fcf7a99431e102df4db3179009f /drivers/net/ethernet/realtek/r8169.c
parentb2d3298e0916fa059712691c85a0e97becc4ab9f (diff)
r8169: move the driver removal method to the end of the driver file.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com>
Diffstat (limited to 'drivers/net/ethernet/realtek/r8169.c')
-rw-r--r--drivers/net/ethernet/realtek/r8169.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index c04df3d2b2a9..ef6ef604f174 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -4263,34 +4263,6 @@ err_out_free_dev_1:
4263 goto out; 4263 goto out;
4264} 4264}
4265 4265
4266static void __devexit rtl8169_remove_one(struct pci_dev *pdev)
4267{
4268 struct net_device *dev = pci_get_drvdata(pdev);
4269 struct rtl8169_private *tp = netdev_priv(dev);
4270
4271 if (tp->mac_version == RTL_GIGA_MAC_VER_27 ||
4272 tp->mac_version == RTL_GIGA_MAC_VER_28 ||
4273 tp->mac_version == RTL_GIGA_MAC_VER_31) {
4274 rtl8168_driver_stop(tp);
4275 }
4276
4277 cancel_work_sync(&tp->wk.work);
4278
4279 unregister_netdev(dev);
4280
4281 rtl_release_firmware(tp);
4282
4283 if (pci_dev_run_wake(pdev))
4284 pm_runtime_get_noresume(&pdev->dev);
4285
4286 /* restore original MAC address */
4287 rtl_rar_set(tp, dev->perm_addr);
4288
4289 rtl_disable_msi(pdev, tp);
4290 rtl8169_release_board(pdev, dev, tp->mmio_addr);
4291 pci_set_drvdata(pdev, NULL);
4292}
4293
4294static void rtl_request_uncached_firmware(struct rtl8169_private *tp) 4266static void rtl_request_uncached_firmware(struct rtl8169_private *tp)
4295{ 4267{
4296 struct rtl_fw *rtl_fw; 4268 struct rtl_fw *rtl_fw;
@@ -6316,11 +6288,39 @@ static void rtl_shutdown(struct pci_dev *pdev)
6316 pm_runtime_put_noidle(d); 6288 pm_runtime_put_noidle(d);
6317} 6289}
6318 6290
6291static void __devexit rtl_remove_one(struct pci_dev *pdev)
6292{
6293 struct net_device *dev = pci_get_drvdata(pdev);
6294 struct rtl8169_private *tp = netdev_priv(dev);
6295
6296 if (tp->mac_version == RTL_GIGA_MAC_VER_27 ||
6297 tp->mac_version == RTL_GIGA_MAC_VER_28 ||
6298 tp->mac_version == RTL_GIGA_MAC_VER_31) {
6299 rtl8168_driver_stop(tp);
6300 }
6301
6302 cancel_work_sync(&tp->wk.work);
6303
6304 unregister_netdev(dev);
6305
6306 rtl_release_firmware(tp);
6307
6308 if (pci_dev_run_wake(pdev))
6309 pm_runtime_get_noresume(&pdev->dev);
6310
6311 /* restore original MAC address */
6312 rtl_rar_set(tp, dev->perm_addr);
6313
6314 rtl_disable_msi(pdev, tp);
6315 rtl8169_release_board(pdev, dev, tp->mmio_addr);
6316 pci_set_drvdata(pdev, NULL);
6317}
6318
6319static struct pci_driver rtl8169_pci_driver = { 6319static struct pci_driver rtl8169_pci_driver = {
6320 .name = MODULENAME, 6320 .name = MODULENAME,
6321 .id_table = rtl8169_pci_tbl, 6321 .id_table = rtl8169_pci_tbl,
6322 .probe = rtl8169_init_one, 6322 .probe = rtl8169_init_one,
6323 .remove = __devexit_p(rtl8169_remove_one), 6323 .remove = __devexit_p(rtl_remove_one),
6324 .shutdown = rtl_shutdown, 6324 .shutdown = rtl_shutdown,
6325 .driver.pm = RTL8169_PM_OPS, 6325 .driver.pm = RTL8169_PM_OPS,
6326}; 6326};