]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/bcma/driver_pci.c
Merge remote-tracking branch 'moduleh/module.h-split'
[karo-tx-linux.git] / drivers / bcma / driver_pci.c
index e0d79d074480ffd3f6f22eff3ec44e78366b51f0..4fde6254f04e236a71ea6f755df4e106aef0f495 100644 (file)
@@ -174,7 +174,7 @@ static bool bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc)
                return false;
 
 #ifdef CONFIG_SSB_DRIVER_PCICORE
-       if (bus->sprom.boardflags_lo & SSB_PCICORE_BFL_NOPCI)
+       if (bus->sprom.boardflags_lo & SSB_BFL_NOPCI)
                return false;
 #endif /* CONFIG_SSB_DRIVER_PCICORE */
 
@@ -190,6 +190,9 @@ static bool bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc)
 
 void bcma_core_pci_init(struct bcma_drv_pci *pc)
 {
+       if (pc->setup_done)
+               return;
+
        if (bcma_core_pci_is_in_hostmode(pc)) {
 #ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
                bcma_core_pci_hostmode_init(pc);
@@ -199,6 +202,8 @@ void bcma_core_pci_init(struct bcma_drv_pci *pc)
        } else {
                bcma_core_pci_clientmode_init(pc);
        }
+
+       pc->setup_done = true;
 }
 
 int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
@@ -206,7 +211,14 @@ int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
 {
        struct pci_dev *pdev = pc->core->bus->host_pci;
        u32 coremask, tmp;
-       int err;
+       int err = 0;
+
+       if (core->bus->hosttype != BCMA_HOSTTYPE_PCI) {
+               /* This bcma device is not on a PCI host-bus. So the IRQs are
+                * not routed through the PCI core.
+                * So we must not enable routing through the PCI core. */
+               goto out;
+       }
 
        err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp);
        if (err)