Skip to content

Commit

Permalink
net: dsa: microchip: enable phy interrupts only if interrupt enabled …
Browse files Browse the repository at this point in the history
…in dts

In the lan937x_mdio_register function, phy interrupts are enabled
irrespective of irq is enabled in the switch. Now, the check is added to
enable the phy interrupt only if the irq is enabled in the switch.

Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Arun Ramadoss authored and Jakub Kicinski committed Sep 26, 2022
1 parent 978f1f7 commit abc1cb8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions drivers/net/dsa/microchip/lan937x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,20 @@ static int lan937x_mdio_register(struct ksz_device *dev)

ds->slave_mii_bus = bus;

ret = lan937x_irq_phy_setup(dev);
if (ret) {
of_node_put(mdio_np);
return ret;
if (dev->irq > 0) {
ret = lan937x_irq_phy_setup(dev);
if (ret) {
of_node_put(mdio_np);
return ret;
}
}

ret = devm_of_mdiobus_register(ds->dev, bus, mdio_np);
if (ret) {
dev_err(ds->dev, "unable to register MDIO bus %s\n",
bus->id);
lan937x_irq_phy_free(dev);
if (dev->irq > 0)
lan937x_irq_phy_free(dev);
}

of_node_put(mdio_np);
Expand Down

0 comments on commit abc1cb8

Please sign in to comment.