[PATCH] PCI: make drivers use the pci shutdown callback instead of the driver core...
authorGreg Kroah-Hartman <gregkh@suse.de>
Fri, 24 Jun 2005 00:35:56 +0000 (17:35 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 28 Jun 2005 04:52:47 +0000 (21:52 -0700)
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>
drivers/message/fusion/mptfc.c
drivers/message/fusion/mptscsih.c
drivers/message/fusion/mptscsih.h
drivers/message/fusion/mptspi.c
drivers/net/e100.c
drivers/net/via-rhine.c
drivers/scsi/3w-9xxx.c
drivers/scsi/3w-xxxx.c
drivers/scsi/ipr.c
drivers/scsi/megaraid.c

index d8d65397e06e668be27cebf001e6681ddfd253c4..353deb25e3978bb300865be18affdbb455545e4a 100644 (file)
@@ -364,9 +364,7 @@ static struct pci_driver mptfc_driver = {
        .id_table       = mptfc_pci_table,
        .probe          = mptfc_probe,
        .remove         = __devexit_p(mptscsih_remove),
-       .driver         = {
-               .shutdown = mptscsih_shutdown,
-        },
+       .shutdown       = mptscsih_shutdown,
 #ifdef CONFIG_PM
        .suspend        = mptscsih_suspend,
        .resume         = mptscsih_resume,
index a0078ae5b9b84587a0d8ed0de8f78f71755d5fc6..4f973a49be4c125e8634dcd29db4ec5649ecc520 100644 (file)
@@ -170,7 +170,7 @@ static void mptscsih_fillbuf(char *buffer, int size, int index, int width);
 #endif
 
 void           mptscsih_remove(struct pci_dev *);
-void           mptscsih_shutdown(struct device *);
+void           mptscsih_shutdown(struct pci_dev *);
 #ifdef CONFIG_PM
 int            mptscsih_suspend(struct pci_dev *pdev, pm_message_t state);
 int            mptscsih_resume(struct pci_dev *pdev);
@@ -988,7 +988,7 @@ mptscsih_remove(struct pci_dev *pdev)
 #endif
 #endif
 
-       mptscsih_shutdown(&pdev->dev);
+       mptscsih_shutdown(pdev);
 
        sz1=0;
 
@@ -1026,9 +1026,9 @@ mptscsih_remove(struct pci_dev *pdev)
  *
  */
 void
-mptscsih_shutdown(struct device * dev)
+mptscsih_shutdown(struct pci_dev *pdev)
 {
-       MPT_ADAPTER             *ioc = pci_get_drvdata(to_pci_dev(dev));
+       MPT_ADAPTER             *ioc = pci_get_drvdata(pdev);
        struct Scsi_Host        *host = ioc->sh;
        MPT_SCSI_HOST           *hd;
 
@@ -1054,7 +1054,7 @@ mptscsih_shutdown(struct device * dev)
 int
 mptscsih_suspend(struct pci_dev *pdev, pm_message_t state)
 {
-       mptscsih_shutdown(&pdev->dev);
+       mptscsih_shutdown(pdev);
        return mpt_suspend(pdev,state);
 }
 
index d73aec33e16a35ee3bac0b3109d8a6ae4739b706..5ea89bf0df199862e26c1398f006818b852ea66d 100644 (file)
@@ -82,7 +82,7 @@
 #endif
 
 extern void mptscsih_remove(struct pci_dev *);
-extern void mptscsih_shutdown(struct device *);
+extern void mptscsih_shutdown(struct pci_dev *);
 #ifdef CONFIG_PM
 extern int mptscsih_suspend(struct pci_dev *pdev, u32 state);
 extern int mptscsih_resume(struct pci_dev *pdev);
index 5f9a61b85b3b6c3b0c65c1f0581f21fe09769b22..e0c0ee5bc9662386e73c79af9ceded98d9623a72 100644 (file)
@@ -419,9 +419,7 @@ static struct pci_driver mptspi_driver = {
        .id_table       = mptspi_pci_table,
        .probe          = mptspi_probe,
        .remove         = __devexit_p(mptscsih_remove),
-       .driver         = {
-               .shutdown = mptscsih_shutdown,
-        },
+       .shutdown       = mptscsih_shutdown,
 #ifdef CONFIG_PM
        .suspend        = mptscsih_suspend,
        .resume         = mptscsih_resume,
index cfaa6b2bf345e7f2dbe504c1c95e18a006cb23cc..be973a1c3c533e84e0cbcb66a446d9027955c8c3 100644 (file)
@@ -2440,9 +2440,8 @@ static int e100_resume(struct pci_dev *pdev)
 #endif
 
 
-static void e100_shutdown(struct device *dev)
+static void e100_shutdown(struct pci_dev *pdev)
 {
-       struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
        struct net_device *netdev = pci_get_drvdata(pdev);
        struct nic *nic = netdev_priv(netdev);
 
@@ -2463,11 +2462,7 @@ static struct pci_driver e100_driver = {
        .suspend =      e100_suspend,
        .resume =       e100_resume,
 #endif
-
-       .driver = {
-               .shutdown = e100_shutdown,
-       }
-
+       .shutdown =     e100_shutdown,
 };
 
 static int __init e100_init_module(void)
index 6200cfc4244e0ba783f24acb0eeabe3f63e4d041..16212e69a49e20eb2563e62477b129cc95e05255 100644 (file)
@@ -507,7 +507,7 @@ static struct net_device_stats *rhine_get_stats(struct net_device *dev);
 static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 static struct ethtool_ops netdev_ethtool_ops;
 static int  rhine_close(struct net_device *dev);
-static void rhine_shutdown (struct device *gdev);
+static void rhine_shutdown (struct pci_dev *pdev);
 
 #define RHINE_WAIT_FOR(condition) do {                                 \
        int i=1024;                                                     \
@@ -1895,9 +1895,8 @@ static void __devexit rhine_remove_one(struct pci_dev *pdev)
        pci_set_drvdata(pdev, NULL);
 }
 
-static void rhine_shutdown (struct device *gendev)
+static void rhine_shutdown (struct pci_dev *pdev)
 {
-       struct pci_dev *pdev = to_pci_dev(gendev);
        struct net_device *dev = pci_get_drvdata(pdev);
        struct rhine_private *rp = netdev_priv(dev);
        void __iomem *ioaddr = rp->base;
@@ -1956,7 +1955,7 @@ static int rhine_suspend(struct pci_dev *pdev, pm_message_t state)
        pci_save_state(pdev);
 
        spin_lock_irqsave(&rp->lock, flags);
-       rhine_shutdown(&pdev->dev);
+       rhine_shutdown(pdev);
        spin_unlock_irqrestore(&rp->lock, flags);
 
        free_irq(dev->irq, dev);
@@ -2010,9 +2009,7 @@ static struct pci_driver rhine_driver = {
        .suspend        = rhine_suspend,
        .resume         = rhine_resume,
 #endif /* CONFIG_PM */
-       .driver = {
-               .shutdown = rhine_shutdown,
-       }
+       .shutdown =     rhine_shutdown,
 };
 
 
index 34dbc37a79d4991f8b40d9e61ad01c32b07000a9..bc6e4627c7a1e450b097b9a117e01e03e667f293 100644 (file)
@@ -1916,9 +1916,9 @@ static void __twa_shutdown(TW_Device_Extension *tw_dev)
 } /* End __twa_shutdown() */
 
 /* Wrapper for __twa_shutdown */
-static void twa_shutdown(struct device *dev)
+static void twa_shutdown(struct pci_dev *pdev)
 {
-       struct Scsi_Host *host = pci_get_drvdata(to_pci_dev(dev));
+       struct Scsi_Host *host = pci_get_drvdata(pdev);
        TW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata;
 
        __twa_shutdown(tw_dev);
@@ -2140,9 +2140,7 @@ static struct pci_driver twa_driver = {
        .id_table       = twa_pci_tbl,
        .probe          = twa_probe,
        .remove         = twa_remove,
-       .driver         = {
-               .shutdown = twa_shutdown
-       }
+       .shutdown       = twa_shutdown
 };
 
 /* This function is called on driver initialization */
index b6dc576da4306f28f861ffe853bb536444410627..973c51fb0fe22b45aeda77a98fc4800224797697 100644 (file)
@@ -2264,9 +2264,9 @@ static void __tw_shutdown(TW_Device_Extension *tw_dev)
 } /* End __tw_shutdown() */
 
 /* Wrapper for __tw_shutdown */
-static void tw_shutdown(struct device *dev)
+static void tw_shutdown(struct pci_dev *pdev)
 {
-       struct Scsi_Host *host = pci_get_drvdata(to_pci_dev(dev));
+       struct Scsi_Host *host = pci_get_drvdata(pdev);
        TW_Device_Extension *tw_dev = (TW_Device_Extension *)host->hostdata;
 
        __tw_shutdown(tw_dev);
@@ -2451,9 +2451,7 @@ static struct pci_driver tw_driver = {
        .id_table       = tw_pci_tbl,
        .probe          = tw_probe,
        .remove         = tw_remove,
-       .driver         = {
-               .shutdown = tw_shutdown
-       }
+       .shutdown       = tw_shutdown,
 };
 
 /* This function is called on driver initialization */
index 80d022625c82e25ccb8eb06f905631746e3d7113..babd48363402b6e1031f0f516ceec0d034766757 100644 (file)
@@ -6012,7 +6012,7 @@ static int __devinit ipr_probe(struct pci_dev *pdev,
 
 /**
  * ipr_shutdown - Shutdown handler.
- * @dev:       device struct
+ * @pdev:      pci device struct
  *
  * This function is invoked upon system shutdown/reboot. It will issue
  * an adapter shutdown to the adapter to flush the write cache.
@@ -6020,9 +6020,9 @@ static int __devinit ipr_probe(struct pci_dev *pdev,
  * Return value:
  *     none
  **/
-static void ipr_shutdown(struct device *dev)
+static void ipr_shutdown(struct pci_dev *pdev)
 {
-       struct ipr_ioa_cfg *ioa_cfg = pci_get_drvdata(to_pci_dev(dev));
+       struct ipr_ioa_cfg *ioa_cfg = pci_get_drvdata(pdev);
        unsigned long lock_flags = 0;
 
        spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
@@ -6068,9 +6068,7 @@ static struct pci_driver ipr_driver = {
        .id_table = ipr_pci_table,
        .probe = ipr_probe,
        .remove = ipr_remove,
-       .driver = {
-               .shutdown = ipr_shutdown,
-       },
+       .shutdown = ipr_shutdown,
 };
 
 /**
index ec81532eb8455b5af006f0d34f25f685e1f2b698..a70cdf31311cc8b7841952ccb8138935eb228e75 100644 (file)
@@ -5036,9 +5036,9 @@ megaraid_remove_one(struct pci_dev *pdev)
 }
 
 static void
-megaraid_shutdown(struct device *dev)
+megaraid_shutdown(struct pci_dev *pdev)
 {
-       struct Scsi_Host *host = pci_get_drvdata(to_pci_dev(dev));
+       struct Scsi_Host *host = pci_get_drvdata(pdev);
        adapter_t *adapter = (adapter_t *)host->hostdata;
 
        __megaraid_shutdown(adapter);
@@ -5070,9 +5070,7 @@ static struct pci_driver megaraid_pci_driver = {
        .id_table       = megaraid_pci_tbl,
        .probe          = megaraid_probe_one,
        .remove         = __devexit_p(megaraid_remove_one),
-       .driver         = {
-               .shutdown = megaraid_shutdown,
-       },
+       .shutdown       = megaraid_shutdown,
 };
 
 static int __init megaraid_init(void)