Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[safe/jmp/linux-2.6] / drivers / ssb / driver_pcicore.c
index 2cc668a..538c570 100644 (file)
@@ -537,12 +537,19 @@ int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc,
        int err = 0;
        u32 tmp;
 
-       might_sleep();
+       if (dev->bus->bustype != SSB_BUSTYPE_PCI) {
+               /* This SSB 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;
+       }
 
        if (!pdev)
                goto out;
        bus = pdev->bus;
 
+       might_sleep_if(pdev->id.coreid != SSB_DEV_PCI);
+
        /* Enable interrupts for this device. */
        if (bus->host_pci &&
            ((pdev->id.revision >= 6) || (pdev->id.coreid == SSB_DEV_PCIE))) {
@@ -562,15 +569,9 @@ int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc,
                u32 intvec;
 
                intvec = ssb_read32(pdev, SSB_INTVEC);
-               if ((bus->chip_id & 0xFF00) == 0x4400) {
-                       /* Workaround: On the BCM44XX the BPFLAG routing
-                        * bit is wrong. Use a hardcoded constant. */
-                       intvec |= 0x00000002;
-               } else {
-                       tmp = ssb_read32(dev, SSB_TPSFLAG);
-                       tmp &= SSB_TPSFLAG_BPFLAG;
-                       intvec |= (1 << tmp);
-               }
+               tmp = ssb_read32(dev, SSB_TPSFLAG);
+               tmp &= SSB_TPSFLAG_BPFLAG;
+               intvec |= (1 << tmp);
                ssb_write32(pdev, SSB_INTVEC, intvec);
        }