[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220922071028.18012-3-arun.ramadoss@microchip.com>
Date: Thu, 22 Sep 2022 12:40:24 +0530
From: Arun Ramadoss <arun.ramadoss@...rochip.com>
To: <linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>
CC: <woojung.huh@...rochip.com>, <UNGLinuxDriver@...rochip.com>,
<andrew@...n.ch>, <vivien.didelot@...il.com>,
<f.fainelli@...il.com>, <olteanv@...il.com>, <davem@...emloft.net>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
<linux@...linux.org.uk>, <Tristram.Ha@...rochip.com>,
<arun.ramadoss@...rochip.com>,
<prasanna.vengateshan@...rochip.com>, <hkallweit1@...il.com>
Subject: [Patch net-next v4 2/6] 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 <arun.ramadoss@...rochip.com>
Reviewed-by: Andrew Lunn <andrew@...n.ch>
---
drivers/net/dsa/microchip/lan937x_main.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/net/dsa/microchip/lan937x_main.c b/drivers/net/dsa/microchip/lan937x_main.c
index a606d78c057e..2664331cc743 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);
--
2.36.1
Powered by blists - more mailing lists