diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2020-03-16 22:32:33 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-17 20:58:22 -0700 |
commit | 9010f9deb000edce823cb79345f137742ccffa19 (patch) | |
tree | 52169d22cd01474d5d4e3a4398c981f37847c98f /drivers/net/phy/mscc | |
parent | 225fc22388e5154b37c9d67732f5b01a6db5bc22 (diff) |
net: phy: improve phy_driver callback handle_interrupt
did_interrupt() clears the interrupt, therefore handle_interrupt() can
not check which event triggered the interrupt. To overcome this
constraint and allow more flexibility for customer interrupt handlers,
let's decouple handle_interrupt() from parts of the phylib interrupt
handling. Custom interrupt handlers now have to implement the
did_interrupt() functionality in handle_interrupt() if needed.
Fortunately we have just one custom interrupt handler so far (in the
mscc PHY driver), convert it to the changed API.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/mscc')
-rw-r--r-- | drivers/net/phy/mscc/mscc_main.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/phy/mscc/mscc_main.c b/drivers/net/phy/mscc/mscc_main.c index cb4d65f81095..4727aba8e051 100644 --- a/drivers/net/phy/mscc/mscc_main.c +++ b/drivers/net/phy/mscc/mscc_main.c @@ -1429,11 +1429,18 @@ err: return ret; } -static int vsc8584_handle_interrupt(struct phy_device *phydev) +static irqreturn_t vsc8584_handle_interrupt(struct phy_device *phydev) { + int irq_status; + + irq_status = phy_read(phydev, MII_VSC85XX_INT_STATUS); + if (irq_status < 0 || !(irq_status & MII_VSC85XX_INT_MASK_MASK)) + return IRQ_NONE; + vsc8584_handle_macsec_interrupt(phydev); phy_mac_interrupt(phydev); - return 0; + + return IRQ_HANDLED; } static int vsc85xx_config_init(struct phy_device *phydev) |