[PATCH] PCI: make drivers use the pci shutdown callback instead of the driver core callback.

Now we can change the pci core to always set this pointer, as pci drivers
should use it, not the driver core callback.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+27 -47
+1 -3
drivers/message/fusion/mptfc.c
··· 364 .id_table = mptfc_pci_table, 365 .probe = mptfc_probe, 366 .remove = __devexit_p(mptscsih_remove), 367 - .driver = { 368 - .shutdown = mptscsih_shutdown, 369 - }, 370 #ifdef CONFIG_PM 371 .suspend = mptscsih_suspend, 372 .resume = mptscsih_resume,
··· 364 .id_table = mptfc_pci_table, 365 .probe = mptfc_probe, 366 .remove = __devexit_p(mptscsih_remove), 367 + .shutdown = mptscsih_shutdown, 368 #ifdef CONFIG_PM 369 .suspend = mptscsih_suspend, 370 .resume = mptscsih_resume,
+5 -5
drivers/message/fusion/mptscsih.c
··· 170 #endif 171 172 void mptscsih_remove(struct pci_dev *); 173 - void mptscsih_shutdown(struct device *); 174 #ifdef CONFIG_PM 175 int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state); 176 int mptscsih_resume(struct pci_dev *pdev); ··· 988 #endif 989 #endif 990 991 - mptscsih_shutdown(&pdev->dev); 992 993 sz1=0; 994 ··· 1026 * 1027 */ 1028 void 1029 - mptscsih_shutdown(struct device * dev) 1030 { 1031 - MPT_ADAPTER *ioc = pci_get_drvdata(to_pci_dev(dev)); 1032 struct Scsi_Host *host = ioc->sh; 1033 MPT_SCSI_HOST *hd; 1034 ··· 1054 int 1055 mptscsih_suspend(struct pci_dev *pdev, pm_message_t state) 1056 { 1057 - mptscsih_shutdown(&pdev->dev); 1058 return mpt_suspend(pdev,state); 1059 } 1060
··· 170 #endif 171 172 void mptscsih_remove(struct pci_dev *); 173 + void mptscsih_shutdown(struct pci_dev *); 174 #ifdef CONFIG_PM 175 int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state); 176 int mptscsih_resume(struct pci_dev *pdev); ··· 988 #endif 989 #endif 990 991 + mptscsih_shutdown(pdev); 992 993 sz1=0; 994 ··· 1026 * 1027 */ 1028 void 1029 + mptscsih_shutdown(struct pci_dev *pdev) 1030 { 1031 + MPT_ADAPTER *ioc = pci_get_drvdata(pdev); 1032 struct Scsi_Host *host = ioc->sh; 1033 MPT_SCSI_HOST *hd; 1034 ··· 1054 int 1055 mptscsih_suspend(struct pci_dev *pdev, pm_message_t state) 1056 { 1057 + mptscsih_shutdown(pdev); 1058 return mpt_suspend(pdev,state); 1059 } 1060
+1 -1
drivers/message/fusion/mptscsih.h
··· 82 #endif 83 84 extern void mptscsih_remove(struct pci_dev *); 85 - extern void mptscsih_shutdown(struct device *); 86 #ifdef CONFIG_PM 87 extern int mptscsih_suspend(struct pci_dev *pdev, u32 state); 88 extern int mptscsih_resume(struct pci_dev *pdev);
··· 82 #endif 83 84 extern void mptscsih_remove(struct pci_dev *); 85 + extern void mptscsih_shutdown(struct pci_dev *); 86 #ifdef CONFIG_PM 87 extern int mptscsih_suspend(struct pci_dev *pdev, u32 state); 88 extern int mptscsih_resume(struct pci_dev *pdev);
+1 -3
drivers/message/fusion/mptspi.c
··· 419 .id_table = mptspi_pci_table, 420 .probe = mptspi_probe, 421 .remove = __devexit_p(mptscsih_remove), 422 - .driver = { 423 - .shutdown = mptscsih_shutdown, 424 - }, 425 #ifdef CONFIG_PM 426 .suspend = mptscsih_suspend, 427 .resume = mptscsih_resume,
··· 419 .id_table = mptspi_pci_table, 420 .probe = mptspi_probe, 421 .remove = __devexit_p(mptscsih_remove), 422 + .shutdown = mptscsih_shutdown, 423 #ifdef CONFIG_PM 424 .suspend = mptscsih_suspend, 425 .resume = mptscsih_resume,
+2 -7
drivers/net/e100.c
··· 2440 #endif 2441 2442 2443 - static void e100_shutdown(struct device *dev) 2444 { 2445 - struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); 2446 struct net_device *netdev = pci_get_drvdata(pdev); 2447 struct nic *nic = netdev_priv(netdev); 2448 ··· 2462 .suspend = e100_suspend, 2463 .resume = e100_resume, 2464 #endif 2465 - 2466 - .driver = { 2467 - .shutdown = e100_shutdown, 2468 - } 2469 - 2470 }; 2471 2472 static int __init e100_init_module(void)
··· 2440 #endif 2441 2442 2443 + static void e100_shutdown(struct pci_dev *pdev) 2444 { 2445 struct net_device *netdev = pci_get_drvdata(pdev); 2446 struct nic *nic = netdev_priv(netdev); 2447 ··· 2463 .suspend = e100_suspend, 2464 .resume = e100_resume, 2465 #endif 2466 + .shutdown = e100_shutdown, 2467 }; 2468 2469 static int __init e100_init_module(void)
+4 -7
drivers/net/via-rhine.c
··· 507 static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 508 static struct ethtool_ops netdev_ethtool_ops; 509 static int rhine_close(struct net_device *dev); 510 - static void rhine_shutdown (struct device *gdev); 511 512 #define RHINE_WAIT_FOR(condition) do { \ 513 int i=1024; \ ··· 1895 pci_set_drvdata(pdev, NULL); 1896 } 1897 1898 - static void rhine_shutdown (struct device *gendev) 1899 { 1900 - struct pci_dev *pdev = to_pci_dev(gendev); 1901 struct net_device *dev = pci_get_drvdata(pdev); 1902 struct rhine_private *rp = netdev_priv(dev); 1903 void __iomem *ioaddr = rp->base; ··· 1955 pci_save_state(pdev); 1956 1957 spin_lock_irqsave(&rp->lock, flags); 1958 - rhine_shutdown(&pdev->dev); 1959 spin_unlock_irqrestore(&rp->lock, flags); 1960 1961 free_irq(dev->irq, dev); ··· 2009 .suspend = rhine_suspend, 2010 .resume = rhine_resume, 2011 #endif /* CONFIG_PM */ 2012 - .driver = { 2013 - .shutdown = rhine_shutdown, 2014 - } 2015 }; 2016 2017
··· 507 static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 508 static struct ethtool_ops netdev_ethtool_ops; 509 static int rhine_close(struct net_device *dev); 510 + static void rhine_shutdown (struct pci_dev *pdev); 511 512 #define RHINE_WAIT_FOR(condition) do { \ 513 int i=1024; \ ··· 1895 pci_set_drvdata(pdev, NULL); 1896 } 1897 1898 + static void rhine_shutdown (struct pci_dev *pdev) 1899 { 1900 struct net_device *dev = pci_get_drvdata(pdev); 1901 struct rhine_private *rp = netdev_priv(dev); 1902 void __iomem *ioaddr = rp->base; ··· 1956 pci_save_state(pdev); 1957 1958 spin_lock_irqsave(&rp->lock, flags); 1959 + rhine_shutdown(pdev); 1960 spin_unlock_irqrestore(&rp->lock, flags); 1961 1962 free_irq(dev->irq, dev); ··· 2010 .suspend = rhine_suspend, 2011 .resume = rhine_resume, 2012 #endif /* CONFIG_PM */ 2013 + .shutdown = rhine_shutdown, 2014 }; 2015 2016
+3 -5
drivers/scsi/3w-9xxx.c
··· 1916 } /* End __twa_shutdown() */ 1917 1918 /* Wrapper for __twa_shutdown */ 1919 - static void twa_shutdown(struct device *dev) 1920 { 1921 - struct Scsi_Host *host = pci_get_drvdata(to_pci_dev(dev)); 1922 TW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata; 1923 1924 __twa_shutdown(tw_dev); ··· 2140 .id_table = twa_pci_tbl, 2141 .probe = twa_probe, 2142 .remove = twa_remove, 2143 - .driver = { 2144 - .shutdown = twa_shutdown 2145 - } 2146 }; 2147 2148 /* This function is called on driver initialization */
··· 1916 } /* End __twa_shutdown() */ 1917 1918 /* Wrapper for __twa_shutdown */ 1919 + static void twa_shutdown(struct pci_dev *pdev) 1920 { 1921 + struct Scsi_Host *host = pci_get_drvdata(pdev); 1922 TW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata; 1923 1924 __twa_shutdown(tw_dev); ··· 2140 .id_table = twa_pci_tbl, 2141 .probe = twa_probe, 2142 .remove = twa_remove, 2143 + .shutdown = twa_shutdown 2144 }; 2145 2146 /* This function is called on driver initialization */
+3 -5
drivers/scsi/3w-xxxx.c
··· 2264 } /* End __tw_shutdown() */ 2265 2266 /* Wrapper for __tw_shutdown */ 2267 - static void tw_shutdown(struct device *dev) 2268 { 2269 - struct Scsi_Host *host = pci_get_drvdata(to_pci_dev(dev)); 2270 TW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata; 2271 2272 __tw_shutdown(tw_dev); ··· 2451 .id_table = tw_pci_tbl, 2452 .probe = tw_probe, 2453 .remove = tw_remove, 2454 - .driver = { 2455 - .shutdown = tw_shutdown 2456 - } 2457 }; 2458 2459 /* This function is called on driver initialization */
··· 2264 } /* End __tw_shutdown() */ 2265 2266 /* Wrapper for __tw_shutdown */ 2267 + static void tw_shutdown(struct pci_dev *pdev) 2268 { 2269 + struct Scsi_Host *host = pci_get_drvdata(pdev); 2270 TW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata; 2271 2272 __tw_shutdown(tw_dev); ··· 2451 .id_table = tw_pci_tbl, 2452 .probe = tw_probe, 2453 .remove = tw_remove, 2454 + .shutdown = tw_shutdown, 2455 }; 2456 2457 /* This function is called on driver initialization */
+4 -6
drivers/scsi/ipr.c
··· 6012 6013 /** 6014 * ipr_shutdown - Shutdown handler. 6015 - * @dev: device struct 6016 * 6017 * This function is invoked upon system shutdown/reboot. It will issue 6018 * an adapter shutdown to the adapter to flush the write cache. ··· 6020 * Return value: 6021 * none 6022 **/ 6023 - static void ipr_shutdown(struct device *dev) 6024 { 6025 - struct ipr_ioa_cfg *ioa_cfg = pci_get_drvdata(to_pci_dev(dev)); 6026 unsigned long lock_flags = 0; 6027 6028 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); ··· 6068 .id_table = ipr_pci_table, 6069 .probe = ipr_probe, 6070 .remove = ipr_remove, 6071 - .driver = { 6072 - .shutdown = ipr_shutdown, 6073 - }, 6074 }; 6075 6076 /**
··· 6012 6013 /** 6014 * ipr_shutdown - Shutdown handler. 6015 + * @pdev: pci device struct 6016 * 6017 * This function is invoked upon system shutdown/reboot. It will issue 6018 * an adapter shutdown to the adapter to flush the write cache. ··· 6020 * Return value: 6021 * none 6022 **/ 6023 + static void ipr_shutdown(struct pci_dev *pdev) 6024 { 6025 + struct ipr_ioa_cfg *ioa_cfg = pci_get_drvdata(pdev); 6026 unsigned long lock_flags = 0; 6027 6028 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); ··· 6068 .id_table = ipr_pci_table, 6069 .probe = ipr_probe, 6070 .remove = ipr_remove, 6071 + .shutdown = ipr_shutdown, 6072 }; 6073 6074 /**
+3 -5
drivers/scsi/megaraid.c
··· 5036 } 5037 5038 static void 5039 - megaraid_shutdown(struct device *dev) 5040 { 5041 - struct Scsi_Host *host = pci_get_drvdata(to_pci_dev(dev)); 5042 adapter_t *adapter = (adapter_t *)host->hostdata; 5043 5044 __megaraid_shutdown(adapter); ··· 5070 .id_table = megaraid_pci_tbl, 5071 .probe = megaraid_probe_one, 5072 .remove = __devexit_p(megaraid_remove_one), 5073 - .driver = { 5074 - .shutdown = megaraid_shutdown, 5075 - }, 5076 }; 5077 5078 static int __init megaraid_init(void)
··· 5036 } 5037 5038 static void 5039 + megaraid_shutdown(struct pci_dev *pdev) 5040 { 5041 + struct Scsi_Host *host = pci_get_drvdata(pdev); 5042 adapter_t *adapter = (adapter_t *)host->hostdata; 5043 5044 __megaraid_shutdown(adapter); ··· 5070 .id_table = megaraid_pci_tbl, 5071 .probe = megaraid_probe_one, 5072 .remove = __devexit_p(megaraid_remove_one), 5073 + .shutdown = megaraid_shutdown, 5074 }; 5075 5076 static int __init megaraid_init(void)