Commit 27b727c8 authored by Adam J. Richter's avatar Adam J. Richter Committed by Linus Torvalds

Use pci_[gs]et_drvdata instead of directly referenced ->driver_data

in struct pci_dev.
parent cb2af32e
...@@ -1041,7 +1041,7 @@ static int __devinit mm_pci_probe(struct pci_dev *dev, const struct pci_device_i ...@@ -1041,7 +1041,7 @@ static int __devinit mm_pci_probe(struct pci_dev *dev, const struct pci_device_i
spin_lock_init(&card->lock); spin_lock_init(&card->lock);
dev->driver_data = card; pci_set_drvdata(dev, card);
if (pci_write_cmd != 0x0F) /* If not Memory Write & Invalidate */ if (pci_write_cmd != 0x0F) /* If not Memory Write & Invalidate */
pci_write_cmd = 0x07; /* then Memory Write command */ pci_write_cmd = 0x07; /* then Memory Write command */
...@@ -1100,7 +1100,7 @@ static int __devinit mm_pci_probe(struct pci_dev *dev, const struct pci_device_i ...@@ -1100,7 +1100,7 @@ static int __devinit mm_pci_probe(struct pci_dev *dev, const struct pci_device_i
*/ */
static void mm_pci_remove(struct pci_dev *dev) static void mm_pci_remove(struct pci_dev *dev)
{ {
struct cardinfo *card = dev->driver_data; struct cardinfo *card = pci_get_drvdata(dev);
tasklet_kill(&card->tasklet); tasklet_kill(&card->tasklet);
iounmap(card->csr_remap); iounmap(card->csr_remap);
......
...@@ -316,7 +316,7 @@ static void hpt366_tune_chipset (ide_drive_t *drive, u8 xferspeed) ...@@ -316,7 +316,7 @@ static void hpt366_tune_chipset (ide_drive_t *drive, u8 xferspeed)
#endif #endif
reg2 = pci_bus_clock_list(speed, reg2 = pci_bus_clock_list(speed,
(struct chipset_bus_clock_list_entry *) dev->driver_data); (struct chipset_bus_clock_list_entry *) pci_get_drvdata(dev));
/* /*
* Disable on-chip PIO FIFO/buffer * Disable on-chip PIO FIFO/buffer
* (to avoid problems handling I/O errors later) * (to avoid problems handling I/O errors later)
...@@ -369,7 +369,7 @@ static void hpt370_tune_chipset (ide_drive_t *drive, u8 xferspeed) ...@@ -369,7 +369,7 @@ static void hpt370_tune_chipset (ide_drive_t *drive, u8 xferspeed)
list_conf = pci_bus_clock_list(speed, list_conf = pci_bus_clock_list(speed,
(struct chipset_bus_clock_list_entry *) (struct chipset_bus_clock_list_entry *)
dev->driver_data); pci_get_drvdata(dev));
pci_read_config_dword(dev, drive_pci, &drive_conf); pci_read_config_dword(dev, drive_pci, &drive_conf);
list_conf = (list_conf & ~conf_mask) | (drive_conf & conf_mask); list_conf = (list_conf & ~conf_mask) | (drive_conf & conf_mask);
...@@ -401,7 +401,7 @@ static void hpt372_tune_chipset (ide_drive_t *drive, u8 xferspeed) ...@@ -401,7 +401,7 @@ static void hpt372_tune_chipset (ide_drive_t *drive, u8 xferspeed)
list_conf = pci_bus_clock_list(speed, list_conf = pci_bus_clock_list(speed,
(struct chipset_bus_clock_list_entry *) (struct chipset_bus_clock_list_entry *)
dev->driver_data); pci_get_drvdata(dev));
pci_read_config_dword(dev, drive_pci, &drive_conf); pci_read_config_dword(dev, drive_pci, &drive_conf);
list_conf = (list_conf & ~conf_mask) | (drive_conf & conf_mask); list_conf = (list_conf & ~conf_mask) | (drive_conf & conf_mask);
if (speed < XFER_MW_DMA_0) if (speed < XFER_MW_DMA_0)
...@@ -841,7 +841,7 @@ static int __init init_hpt37x(struct pci_dev *dev) ...@@ -841,7 +841,7 @@ static int __init init_hpt37x(struct pci_dev *dev)
* don't like to use the PLL because it will cause glitches * don't like to use the PLL because it will cause glitches
* on PRST/SRST when the HPT state engine gets reset. * on PRST/SRST when the HPT state engine gets reset.
*/ */
if (dev->driver_data) if (pci_get_drvdata(dev))
goto init_hpt37X_done; goto init_hpt37X_done;
/* /*
...@@ -923,7 +923,7 @@ static int __init init_hpt366 (struct pci_dev *dev) ...@@ -923,7 +923,7 @@ static int __init init_hpt366 (struct pci_dev *dev)
break; break;
} }
if (!dev->driver_data) if (!pci_get_drvdata(dev))
{ {
printk(KERN_ERR "hpt366: unknown bus timing.\n"); printk(KERN_ERR "hpt366: unknown bus timing.\n");
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
...@@ -30,8 +30,8 @@ static int n_siimage_devs; ...@@ -30,8 +30,8 @@ static int n_siimage_devs;
static char * print_siimage_get_info (char *buf, struct pci_dev *dev, int index) static char * print_siimage_get_info (char *buf, struct pci_dev *dev, int index)
{ {
char *p = buf; char *p = buf;
u8 mmio = (dev->driver_data != NULL) ? 1 : 0; u8 mmio = (pci_get_drvdata(dev) != NULL) ? 1 : 0;
u32 bmdma = (mmio) ? ((u32) dev->driver_data) : u32 bmdma = (mmio) ? ((u32) pci_get_drvdata(dev)) :
(pci_resource_start(dev, 4)); (pci_resource_start(dev, 4));
p += sprintf(p, "\nController: %d\n", index); p += sprintf(p, "\nController: %d\n", index);
...@@ -769,14 +769,14 @@ static void __init init_iops_siimage (ide_hwif_t *hwif) ...@@ -769,14 +769,14 @@ static void __init init_iops_siimage (ide_hwif_t *hwif)
if ((dev->device == PCI_DEVICE_ID_SII_3112) && (!(class_rev))) if ((dev->device == PCI_DEVICE_ID_SII_3112) && (!(class_rev)))
hwif->rqsize = 16; hwif->rqsize = 16;
if (dev->driver_data == NULL) if (pci_get_drvdata(dev) == NULL)
return; return;
init_mmio_iops_siimage(hwif); init_mmio_iops_siimage(hwif);
} }
static unsigned int __init ata66_siimage (ide_hwif_t *hwif) static unsigned int __init ata66_siimage (ide_hwif_t *hwif)
{ {
if (hwif->pci_dev->driver_data == NULL) { if (pci_get_drvdata(hwif->pci_dev) == NULL) {
u8 ata66 = 0; u8 ata66 = 0;
pci_read_config_byte(hwif->pci_dev, SELREG(0), &ata66); pci_read_config_byte(hwif->pci_dev, SELREG(0), &ata66);
return (ata66 & 0x01) ? 1 : 0; return (ata66 & 0x01) ? 1 : 0;
......
...@@ -1780,7 +1780,7 @@ static int xl_change_mtu(struct net_device *dev, int mtu) ...@@ -1780,7 +1780,7 @@ static int xl_change_mtu(struct net_device *dev, int mtu)
static void __devexit xl_remove_one (struct pci_dev *pdev) static void __devexit xl_remove_one (struct pci_dev *pdev)
{ {
struct net_device *dev = pdev->driver_data; struct net_device *dev = pci_get_drvdata(pdev);
struct xl_private *xl_priv=(struct xl_private *)dev->priv; struct xl_private *xl_priv=(struct xl_private *)dev->priv;
unregister_trdev(dev); unregister_trdev(dev);
......
...@@ -299,7 +299,7 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_ ...@@ -299,7 +299,7 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
dev->get_stats = &xircom_get_stats; dev->get_stats = &xircom_get_stats;
dev->priv = private; dev->priv = private;
dev->do_ioctl = &private_ioctl; dev->do_ioctl = &private_ioctl;
pdev->driver_data = dev; pci_set_drvdata(pdev, dev);
/* start the transmitter to get a heartbeat */ /* start the transmitter to get a heartbeat */
...@@ -326,7 +326,7 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_ ...@@ -326,7 +326,7 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
*/ */
static void __devexit xircom_remove(struct pci_dev *pdev) static void __devexit xircom_remove(struct pci_dev *pdev)
{ {
struct net_device *dev = pdev->driver_data; struct net_device *dev = pci_get_drvdata(pdev);
struct xircom_private *card; struct xircom_private *card;
enter("xircom_remove"); enter("xircom_remove");
if (dev!=NULL) { if (dev!=NULL) {
......
...@@ -3556,7 +3556,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -3556,7 +3556,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
#endif #endif
/* Set PCI drv pointer to the card structure */ /* Set PCI drv pointer to the card structure */
pdev->driver_data = card; pci_set_drvdata(pdev, card);
/* Set board type */ /* Set board type */
switch (device_id) { switch (device_id) {
...@@ -3631,7 +3631,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -3631,7 +3631,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
static void __devexit cpc_remove_one(struct pci_dev *pdev) static void __devexit cpc_remove_one(struct pci_dev *pdev)
{ {
pc300_t *card = (pc300_t *) pdev->driver_data; pc300_t *card = pci_get_drvdata(pdev);
if (card->hw.rambase != 0) { if (card->hw.rambase != 0) {
int i; int i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment