brcm47xx: various fixes and code cleanups for irq code
[openwrt.git] / target / linux / brcm47xx / patches-3.6 / 235-bcma-dont-expose-mips-irq.patch
index cd28c66..5df8636 100644 (file)
@@ -1,6 +1,6 @@
 --- a/include/linux/bcma/bcma_driver_mips.h
 +++ b/include/linux/bcma/bcma_driver_mips.h
-@@ -49,6 +49,6 @@ static inline void bcma_core_mips_early_
+@@ -48,6 +48,6 @@ static inline void bcma_core_mips_early_
  
  extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore);
  
        cc->nr_serial_ports = (cc->capabilities & BCMA_CC_CAP_NRUART);
 --- a/drivers/bcma/driver_mips.c
 +++ b/drivers/bcma/driver_mips.c
-@@ -81,7 +81,7 @@ static u32 bcma_core_mips_irqflag(struct
/* Get the MIPS IRQ assignment for a specified device.
-  * If unassigned, 0 is returned.
+@@ -86,7 +86,7 @@ static u32 bcma_core_mips_irqflag(struct
 * If disabled, 5 is returned.
+  * If not supported, 6 is returned.
   */
 -unsigned int bcma_core_mips_irq(struct bcma_device *dev)
 +static unsigned int bcma_core_mips_irq(struct bcma_device *dev)
  {
        struct bcma_device *mdev = dev->bus->drv_mips.core;
        u32 irqflag;
-@@ -96,7 +96,12 @@ unsigned int bcma_core_mips_irq(struct b
+@@ -103,7 +103,13 @@ unsigned int bcma_core_mips_irq(struct b
  
-       return 0;
+       return 5;
  }
 -EXPORT_SYMBOL(bcma_core_mips_irq);
 +
 +unsigned int bcma_core_irq(struct bcma_device *dev)
 +{
-+      return bcma_core_mips_irq(dev) + 2;
++      unsigned int mips_irq = bcma_core_mips_irq(dev);
++      return mips_irq <= 4 ? mips_irq + 2 : 0;
 +}
 +EXPORT_SYMBOL(bcma_core_irq);