public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arun Ramadoss <arun.ramadoss@microchip.com>
To: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>
Cc: <woojung.huh@microchip.com>, <UNGLinuxDriver@microchip.com>,
	<andrew@lunn.ch>, <vivien.didelot@gmail.com>,
	<f.fainelli@gmail.com>, <olteanv@gmail.com>,
	<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <linux@armlinux.org.uk>,
	<Tristram.Ha@microchip.com>, <arun.ramadoss@microchip.com>,
	<prasanna.vengateshan@microchip.com>, <hkallweit1@gmail.com>
Subject: [Patch net-next v4 2/6] net: dsa: microchip: enable phy interrupts only if interrupt enabled in dts
Date: Thu, 22 Sep 2022 12:40:24 +0530	[thread overview]
Message-ID: <20220922071028.18012-3-arun.ramadoss@microchip.com> (raw)
In-Reply-To: <20220922071028.18012-1-arun.ramadoss@microchip.com>

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>
---
 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


  parent reply	other threads:[~2022-09-22  7:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22  7:10 [Patch net-next v4 0/6] net: dsa: microchip: ksz9477: enable interrupt for internal phy link detection Arun Ramadoss
2022-09-22  7:10 ` [Patch net-next v4 1/6] net: dsa: microchip: determine number of port irq based on switch type Arun Ramadoss
2022-09-22  7:10 ` Arun Ramadoss [this message]
2022-09-22  7:10 ` [Patch net-next v4 3/6] net: dsa: microchip: lan937x: return zero if mdio node not present Arun Ramadoss
2022-09-23 18:38   ` Andrew Lunn
2022-09-22  7:10 ` [Patch net-next v4 4/6] net: dsa: microchip: move interrupt handling logic from lan937x to ksz_common Arun Ramadoss
2022-09-23 18:39   ` Andrew Lunn
2022-09-23 18:43   ` Andrew Lunn
2022-09-22  7:10 ` [Patch net-next v4 5/6] net: dsa: microchip: use common irq routines for girq and pirq Arun Ramadoss
2022-09-22  7:10 ` [Patch net-next v4 6/6] net: phy: micrel: enable interrupt for ksz9477 phy Arun Ramadoss
2022-09-26 19:50 ` [Patch net-next v4 0/6] net: dsa: microchip: ksz9477: enable interrupt for internal phy link detection patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220922071028.18012-3-arun.ramadoss@microchip.com \
    --to=arun.ramadoss@microchip.com \
    --cc=Tristram.Ha@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=prasanna.vengateshan@microchip.com \
    --cc=vivien.didelot@gmail.com \
    --cc=woojung.huh@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox