Skip to content

Commit

Permalink
[PATCH] PCI: make drivers use the pci shutdown callback instead of th…
Browse files Browse the repository at this point in the history
…e 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>
  • Loading branch information
Greg Kroah-Hartman committed Jun 28, 2005
1 parent 4002307 commit d18c3db
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 47 deletions.
4 changes: 1 addition & 3 deletions drivers/message/fusion/mptfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions drivers/message/fusion/mptscsih.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -988,7 +988,7 @@ mptscsih_remove(struct pci_dev *pdev)
#endif
#endif

mptscsih_shutdown(&pdev->dev);
mptscsih_shutdown(pdev);

sz1=0;

Expand Down Expand Up @@ -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;

Expand All @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/message/fusion/mptscsih.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions drivers/message/fusion/mptspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 2 additions & 7 deletions drivers/net/e100.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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)
Expand Down
11 changes: 4 additions & 7 deletions drivers/net/via-rhine.c
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
};


Expand Down
8 changes: 3 additions & 5 deletions drivers/scsi/3w-9xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 */
Expand Down
8 changes: 3 additions & 5 deletions drivers/scsi/3w-xxxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 */
Expand Down
10 changes: 4 additions & 6 deletions drivers/scsi/ipr.c
Original file line number Diff line number Diff line change
Expand Up @@ -6012,17 +6012,17 @@ 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.
*
* 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);
Expand Down Expand Up @@ -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,
};

/**
Expand Down
8 changes: 3 additions & 5 deletions drivers/scsi/megaraid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d18c3db

Please sign in to comment.