Skip to content

Commit

Permalink
net: dsa: mv88e6xxx: Pass interrupt number in platform data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Lunn authored and David S. Miller committed May 4, 2019
1 parent 3b3600f commit a27415d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
13 changes: 9 additions & 4 deletions drivers/net/dsa/mv88e6xxx/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions include/linux/platform_data/mv88e6xxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct dsa_mv88e6xxx_pdata {
unsigned int enabled_ports;
struct net_device *netdev;
u32 eeprom_len;
int irq;
};

#endif

0 comments on commit a27415d

Please sign in to comment.