Commit 493b82d4 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] PCI: remove pci_find_device() usages from drivers/pci/*

yeah, I ignored the ppc64 hotplug pci driver, they can fix it up themselves...
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent d45fc8df
......@@ -219,12 +219,13 @@ static int zt5550_hc_init_one (struct pci_dev *pdev, const struct pci_device_id
dbg("registered controller");
/* Look for first device matching cPCI bus's bridge vendor and device IDs */
if(!(bus0_dev = pci_find_device(PCI_VENDOR_ID_DEC,
if(!(bus0_dev = pci_get_device(PCI_VENDOR_ID_DEC,
PCI_DEVICE_ID_DEC_21154, NULL))) {
status = -ENODEV;
goto init_register_error;
}
bus0 = bus0_dev->subordinate;
pci_dev_put(bus0_dev);
status = cpci_hp_register_bus(bus0, 0x0a, 0x0f);
if(status != 0) {
......
......@@ -886,7 +886,7 @@ static int set_bus (struct slot * slot_cur)
break;
case BUS_SPEED_133:
/* This is to take care of the bug in CIOBX chip */
while ((dev = pci_find_device(PCI_VENDOR_ID_SERVERWORKS,
while ((dev = pci_get_device(PCI_VENDOR_ID_SERVERWORKS,
0x0101, dev)) != NULL)
ibmphp_hpc_writeslot (slot_cur, HPC_BUS_100PCIXMODE);
cmd = HPC_BUS_133PCIXMODE;
......
......@@ -749,7 +749,7 @@ static int __devinit pci_init(void)
{
struct pci_dev *dev = NULL;
while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
pci_fixup_device(pci_fixup_final, dev);
}
return 0;
......
......@@ -599,7 +599,7 @@ static int __init pci_proc_init(void)
if (entry)
entry->proc_fops = &proc_bus_pci_dev_operations;
proc_initialized = 1;
while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
pci_proc_attach_device(dev);
}
legacy_proc_init();
......
......@@ -30,7 +30,7 @@ static void __devinit quirk_passive_release(struct pci_dev *dev)
/* We have to make sure a particular bit is set in the PIIX3
ISA bridge, so we have to go out and find it. */
while ((d = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_0, d))) {
while ((d = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_0, d))) {
pci_read_config_byte(d, 0x82, &dlc);
if (!(dlc & 1<<1)) {
printk(KERN_ERR "PCI: PIIX3: Enabling Passive Release on %s\n", pci_name(d));
......@@ -116,21 +116,21 @@ static void __devinit quirk_vialatency(struct pci_dev *dev)
/* Ok we have a potential problem chipset here. Now see if we have
a buggy southbridge */
p = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, NULL);
p = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, NULL);
if (p!=NULL) {
pci_read_config_byte(p, PCI_CLASS_REVISION, &rev);
/* 0x40 - 0x4f == 686B, 0x10 - 0x2f == 686A; thanks Dan Hollis */
/* Check for buggy part revisions */
if (rev < 0x40 || rev > 0x42)
return;
if (rev < 0x40 || rev > 0x42)
goto exit;
} else {
p = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, NULL);
p = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, NULL);
if (p==NULL) /* No problem parts */
return;
goto exit;
pci_read_config_byte(p, PCI_CLASS_REVISION, &rev);
/* Check for buggy part revisions */
if (rev < 0x10 || rev > 0x12)
return;
goto exit;
}
/*
......@@ -153,6 +153,8 @@ static void __devinit quirk_vialatency(struct pci_dev *dev)
busarb |= (1<<4);
pci_write_config_byte(dev, 0x76, busarb);
printk(KERN_INFO "Applying VIA southbridge workaround.\n");
exit:
pci_dev_put(p);
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8363_0, quirk_vialatency );
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8371_1, quirk_vialatency );
......
......@@ -65,7 +65,7 @@ pci_fixup_irqs(u8 (*swizzle)(struct pci_dev *, u8 *),
int (*map_irq)(struct pci_dev *, u8, u8))
{
struct pci_dev *dev = NULL;
while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
pdev_fixup_irq(dev, swizzle, map_irq);
}
}
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