[PATCH] pci: bcm43xx avoid pci_find_device
bcm43xx avoid pci_find_device Change pci_find_device to safer pci_get_device with support for more devices. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
91769e7dd9
commit
12a3768792
|
@ -2146,6 +2146,13 @@ out:
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_BCM947XX
|
||||||
|
static struct pci_device_id bcm43xx_47xx_ids[] = {
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4324) },
|
||||||
|
{ 0 }
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
static int bcm43xx_initialize_irq(struct bcm43xx_private *bcm)
|
static int bcm43xx_initialize_irq(struct bcm43xx_private *bcm)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
|
@ -2155,11 +2162,15 @@ static int bcm43xx_initialize_irq(struct bcm43xx_private *bcm)
|
||||||
bcm->irq = bcm->pci_dev->irq;
|
bcm->irq = bcm->pci_dev->irq;
|
||||||
#ifdef CONFIG_BCM947XX
|
#ifdef CONFIG_BCM947XX
|
||||||
if (bcm->pci_dev->bus->number == 0) {
|
if (bcm->pci_dev->bus->number == 0) {
|
||||||
struct pci_dev *d = NULL;
|
struct pci_dev *d;
|
||||||
/* FIXME: we will probably need more device IDs here... */
|
struct pci_device_id *id;
|
||||||
d = pci_find_device(PCI_VENDOR_ID_BROADCOM, 0x4324, NULL);
|
for (id = bcm43xx_47xx_ids; id->vendor; id++) {
|
||||||
if (d != NULL) {
|
d = pci_get_device(id->vendor, id->device, NULL);
|
||||||
bcm->irq = d->irq;
|
if (d != NULL) {
|
||||||
|
bcm->irq = d->irq;
|
||||||
|
pci_dev_put(d);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue