summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/bcm43xx/bcm43xx_main.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2006-06-05 22:20:07 +0200
committerJohn W. Linville <linville@tuxdriver.com>2006-06-15 15:48:13 -0400
commit12a3768792dc27f11a5edb96e38db32bcdc5fd27 (patch)
treeeaf1362f4b3280cdc9347cccee69f49e1f3d310f /drivers/net/wireless/bcm43xx/bcm43xx_main.c
parent91769e7dd9cef7988dc4280f74ed168351beb5b8 (diff)
downloadlwn-12a3768792dc27f11a5edb96e38db32bcdc5fd27.tar.gz
lwn-12a3768792dc27f11a5edb96e38db32bcdc5fd27.zip
[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>
Diffstat (limited to 'drivers/net/wireless/bcm43xx/bcm43xx_main.c')
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_main.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
index 77d0e390b021..085d7857fe31 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -2146,6 +2146,13 @@ out:
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)
{
int res;
@@ -2155,11 +2162,15 @@ static int bcm43xx_initialize_irq(struct bcm43xx_private *bcm)
bcm->irq = bcm->pci_dev->irq;
#ifdef CONFIG_BCM947XX
if (bcm->pci_dev->bus->number == 0) {
- struct pci_dev *d = NULL;
- /* FIXME: we will probably need more device IDs here... */
- d = pci_find_device(PCI_VENDOR_ID_BROADCOM, 0x4324, NULL);
- if (d != NULL) {
- bcm->irq = d->irq;
+ struct pci_dev *d;
+ struct pci_device_id *id;
+ for (id = bcm43xx_47xx_ids; id->vendor; id++) {
+ d = pci_get_device(id->vendor, id->device, NULL);
+ if (d != NULL) {
+ bcm->irq = d->irq;
+ pci_dev_put(d);
+ break;
+ }
}
}
#endif