Commit abc1cb8c authored by Arun Ramadoss's avatar Arun Ramadoss Committed by Jakub Kicinski

net: dsa: microchip: enable phy interrupts only if interrupt enabled 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: default avatarArun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 978f1f72
...@@ -235,17 +235,20 @@ static int lan937x_mdio_register(struct ksz_device *dev) ...@@ -235,17 +235,20 @@ static int lan937x_mdio_register(struct ksz_device *dev)
ds->slave_mii_bus = bus; ds->slave_mii_bus = bus;
ret = lan937x_irq_phy_setup(dev); if (dev->irq > 0) {
if (ret) { ret = lan937x_irq_phy_setup(dev);
of_node_put(mdio_np); if (ret) {
return ret; of_node_put(mdio_np);
return ret;
}
} }
ret = devm_of_mdiobus_register(ds->dev, bus, mdio_np); ret = devm_of_mdiobus_register(ds->dev, bus, mdio_np);
if (ret) { if (ret) {
dev_err(ds->dev, "unable to register MDIO bus %s\n", dev_err(ds->dev, "unable to register MDIO bus %s\n",
bus->id); bus->id);
lan937x_irq_phy_free(dev); if (dev->irq > 0)
lan937x_irq_phy_free(dev);
} }
of_node_put(mdio_np); of_node_put(mdio_np);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment