aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/microchip/lan937x_main.c
diff options
context:
space:
mode:
authorArun Ramadoss <[email protected]>2022-09-22 07:10:24 +0000
committerJakub Kicinski <[email protected]>2022-09-26 19:41:05 +0000
commitabc1cb8cbd7376a2f856e64986ee5ce0849d974b (patch)
tree9ad63d14d2d9c6b3e552f12d24bd4921c8a3e3ee /drivers/net/dsa/microchip/lan937x_main.c
parentnet: dsa: microchip: determine number of port irq based on switch type (diff)
downloadkernel-abc1cb8cbd7376a2f856e64986ee5ce0849d974b.tar.gz
kernel-abc1cb8cbd7376a2f856e64986ee5ce0849d974b.zip
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: Arun Ramadoss <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/dsa/microchip/lan937x_main.c')
-rw-r--r--drivers/net/dsa/microchip/lan937x_main.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/dsa/microchip/lan937x_main.c b/drivers/net/dsa/microchip/lan937x_main.c
index fd5114a09463..c25ac439a927 100644
--- a/drivers/net/dsa/microchip/lan937x_main.c
+++ b/drivers/net/dsa/microchip/lan937x_main.c
@@ -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);