Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: ste10Xp: implement generic .handle_interrupt() callback

In an attempt to actually support shared IRQs in phylib, we now move the
responsibility of triggering the phylib state machine or just returning
IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
3 different IRQ handling callbacks (.handle_interrupt(),
.did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
driver implement directly an IRQ handler like any other device driver.
Make this driver follow the new convention.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Ioana Ciornei and committed by
Jakub Kicinski
80ca9ee7 824ef51f

+20
+20
drivers/net/phy/ste10Xp.c
··· 76 76 return 0; 77 77 } 78 78 79 + static irqreturn_t ste10Xp_handle_interrupt(struct phy_device *phydev) 80 + { 81 + int irq_status; 82 + 83 + irq_status = phy_read(phydev, MII_XCIIS); 84 + if (irq_status < 0) { 85 + phy_error(phydev); 86 + return IRQ_NONE; 87 + } 88 + 89 + if (!(irq_status & MII_XIE_DEFAULT_MASK)) 90 + return IRQ_NONE; 91 + 92 + phy_trigger_machine(phydev); 93 + 94 + return IRQ_HANDLED; 95 + } 96 + 79 97 static struct phy_driver ste10xp_pdriver[] = { 80 98 { 81 99 .phy_id = STE101P_PHY_ID, ··· 103 85 .config_init = ste10Xp_config_init, 104 86 .ack_interrupt = ste10Xp_ack_interrupt, 105 87 .config_intr = ste10Xp_config_intr, 88 + .handle_interrupt = ste10Xp_handle_interrupt, 106 89 .suspend = genphy_suspend, 107 90 .resume = genphy_resume, 108 91 }, { ··· 114 95 .config_init = ste10Xp_config_init, 115 96 .ack_interrupt = ste10Xp_ack_interrupt, 116 97 .config_intr = ste10Xp_config_intr, 98 + .handle_interrupt = ste10Xp_handle_interrupt, 117 99 .suspend = genphy_suspend, 118 100 .resume = genphy_resume, 119 101 } };