aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-10-09 14:30:10 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:47:55 -0400
commit899110fe4e1b26f7a13e639c57e2a047d21bffa2 (patch)
tree7bfdb08107df98db149ad1325a3b366ef3f1b01c /drivers/net/wireless
parent332c556633b8c5fb4e890b1783122f2315526590 (diff)
b43/legacy: Fix usage of host_pci pointer
We must check the bustype before using the host_pci pointer. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/b43/main.c4
-rw-r--r--drivers/net/wireless/b43legacy/main.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index df6b26a0c05e..751017b4c3d3 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4671,7 +4671,7 @@ static int b43_wireless_core_attach(struct b43_wldev *dev)
4671{ 4671{
4672 struct b43_wl *wl = dev->wl; 4672 struct b43_wl *wl = dev->wl;
4673 struct ssb_bus *bus = dev->dev->bus; 4673 struct ssb_bus *bus = dev->dev->bus;
4674 struct pci_dev *pdev = bus->host_pci; 4674 struct pci_dev *pdev = (bus->bustype == SSB_BUSTYPE_PCI) ? bus->host_pci : NULL;
4675 int err; 4675 int err;
4676 bool have_2ghz_phy = 0, have_5ghz_phy = 0; 4676 bool have_2ghz_phy = 0, have_5ghz_phy = 0;
4677 u32 tmp; 4677 u32 tmp;
@@ -4804,7 +4804,7 @@ static int b43_one_core_attach(struct ssb_device *dev, struct b43_wl *wl)
4804 4804
4805 if (!list_empty(&wl->devlist)) { 4805 if (!list_empty(&wl->devlist)) {
4806 /* We are not the first core on this chip. */ 4806 /* We are not the first core on this chip. */
4807 pdev = dev->bus->host_pci; 4807 pdev = (dev->bus->bustype == SSB_BUSTYPE_PCI) ? dev->bus->host_pci : NULL;
4808 /* Only special chips support more than one wireless 4808 /* Only special chips support more than one wireless
4809 * core, although some of the other chips have more than 4809 * core, although some of the other chips have more than
4810 * one wireless core as well. Check for this and 4810 * one wireless core as well. Check for this and
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 1d9223b3d4c4..0983406f4630 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -3592,7 +3592,7 @@ static int b43legacy_wireless_core_attach(struct b43legacy_wldev *dev)
3592{ 3592{
3593 struct b43legacy_wl *wl = dev->wl; 3593 struct b43legacy_wl *wl = dev->wl;
3594 struct ssb_bus *bus = dev->dev->bus; 3594 struct ssb_bus *bus = dev->dev->bus;
3595 struct pci_dev *pdev = bus->host_pci; 3595 struct pci_dev *pdev = (bus->bustype == SSB_BUSTYPE_PCI) ? bus->host_pci : NULL;
3596 int err; 3596 int err;
3597 int have_bphy = 0; 3597 int have_bphy = 0;
3598 int have_gphy = 0; 3598 int have_gphy = 0;
@@ -3706,7 +3706,7 @@ static int b43legacy_one_core_attach(struct ssb_device *dev,
3706 3706
3707 if (!list_empty(&wl->devlist)) { 3707 if (!list_empty(&wl->devlist)) {
3708 /* We are not the first core on this chip. */ 3708 /* We are not the first core on this chip. */
3709 pdev = dev->bus->host_pci; 3709 pdev = (dev->bus->bustype == SSB_BUSTYPE_PCI) ? dev->bus->host_pci : NULL;
3710 /* Only special chips support more than one wireless 3710 /* Only special chips support more than one wireless
3711 * core, although some of the other chips have more than 3711 * core, although some of the other chips have more than
3712 * one wireless core as well. Check for this and 3712 * one wireless core as well. Check for this and