net: dsa: mv88e6xxx: Pass interrupt number in platform data
authorAndrew Lunn <andrew@lunn.ch>
Tue, 30 Apr 2019 22:10:50 +0000 (00:10 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 4 May 2019 03:55:47 +0000 (23:55 -0400)
Allow an interrupt number to be passed in the platform data. The
driver will then use it if not zero, otherwise it will poll for
interrupts.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.c
include/linux/platform_data/mv88e6xxx.h

index 46020fe1b5e7075f4548e38f2a8f4ecd87ec84d9..bad30be699bfd6bdccc57c3fb3e4230e6bacbfbf 100644 (file)
@@ -4894,12 +4894,17 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)
        if (err)
                goto out;
 
-       chip->irq = of_irq_get(np, 0);
-       if (chip->irq == -EPROBE_DEFER) {
-               err = chip->irq;
-               goto out;
+       if (np) {
+               chip->irq = of_irq_get(np, 0);
+               if (chip->irq == -EPROBE_DEFER) {
+                       err = chip->irq;
+                       goto out;
+               }
        }
 
+       if (pdata)
+               chip->irq = pdata->irq;
+
        /* Has to be performed before the MDIO bus is created, because
         * the PHYs will link their interrupts to these interrupt
         * controllers
index 963730b44aeaae4141c28a649eef2d3576623dfd..21452a9365e1e2999abcbbac3a63086c55e3ba86 100644 (file)
@@ -13,6 +13,7 @@ struct dsa_mv88e6xxx_pdata {
        unsigned int enabled_ports;
        struct net_device *netdev;
        u32 eeprom_len;
+       int irq;
 };
 
 #endif