[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221220131921.806365-3-enguerrand.de-ribaucourt@savoirfairelinux.com>
Date: Tue, 20 Dec 2022 14:19:22 +0100
From: Enguerrand de Ribaucourt
<enguerrand.de-ribaucourt@...oirfairelinux.com>
To: netdev@...r.kernel.org
Cc: pabeni@...hat.com, woojung.huh@...rochip.com, davem@...emloft.net,
UNGLinuxDriver@...rochip.com,
Enguerrand de Ribaucourt
<enguerrand.de-ribaucourt@...oirfairelinux.com>
Subject: [PATCH v3 2/3] net: phy: make phy_enable_interrupts() non-static
Currently, phy_disable_interrupts() allows to disable interrupts without
freeing them. However, the only exported function to re-enable them is
phy_request_interrupt(), which also requests them again. It should be
possible to re-enable interrupts without re-allocating them.
This is required for lan78xx.c where we want to enable/disable the phy
interrupts during lan78xx_link_status_change().
Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@...oirfairelinux.com>
---
drivers/net/phy/phy.c | 3 ++-
include/linux/phy.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 33250da76466..4168cf54aa59 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -1040,10 +1040,11 @@ static irqreturn_t phy_interrupt(int irq, void *phy_dat)
* phy_enable_interrupts - Enable the interrupts from the PHY side
* @phydev: target phy_device struct
*/
-static int phy_enable_interrupts(struct phy_device *phydev)
+int phy_enable_interrupts(struct phy_device *phydev)
{
return phy_config_interrupt(phydev, PHY_INTERRUPT_ENABLED);
}
+EXPORT_SYMBOL(phy_enable_interrupts);
/**
* phy_request_interrupt - request and enable interrupt for a PHY device
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 71eeb4e3b1fd..d2350f0dc566 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1715,6 +1715,7 @@ int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
int phy_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
int phy_do_ioctl_running(struct net_device *dev, struct ifreq *ifr, int cmd);
int phy_disable_interrupts(struct phy_device *phydev);
+int phy_enable_interrupts(struct phy_device *phydev);
void phy_request_interrupt(struct phy_device *phydev);
void phy_free_interrupt(struct phy_device *phydev);
void phy_print_status(struct phy_device *phydev);
--
2.25.1
Powered by blists - more mailing lists