OSDN Git Service

net: dsa: b53: Do not fail when IRQ are not initialized
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 13 Sep 2018 16:50:45 +0000 (09:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Sep 2018 17:19:14 +0000 (10:19 -0700)
When the Device Tree is not providing the per-port interrupts, do not fail
during b53_srab_irq_enable() but instead bail out gracefully. The SRAB driver
is used on the BCM5301X (Northstar) platforms which do not yet have the SRAB
interrupts wired up.

Fixes: 16994374a6fc ("net: dsa: b53: Make SRAB driver manage port interrupts")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/b53/b53_srab.c

index 3210527..90f5142 100644 (file)
@@ -415,7 +415,13 @@ static int b53_srab_irq_enable(struct b53_device *dev, int port)
 {
        struct b53_srab_priv *priv = dev->priv;
        struct b53_srab_port_priv *p = &priv->port_intrs[port];
-       int ret;
+       int ret = 0;
+
+       /* Interrupt is optional and was not specified, do not make
+        * this fatal
+        */
+       if (p->irq == -ENXIO)
+               return ret;
 
        ret = request_threaded_irq(p->irq, b53_srab_port_isr,
                                   b53_srab_port_thread, 0,