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

net: phy: adin: 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>
Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Ioana Ciornei and committed by
Jakub Kicinski
66d7439e e1bc534d

+20
+20
drivers/net/phy/adin.c
··· 479 479 ADIN1300_INT_MASK_EN); 480 480 } 481 481 482 + static irqreturn_t adin_phy_handle_interrupt(struct phy_device *phydev) 483 + { 484 + int irq_status; 485 + 486 + irq_status = phy_read(phydev, ADIN1300_INT_STATUS_REG); 487 + if (irq_status < 0) { 488 + phy_error(phydev); 489 + return IRQ_NONE; 490 + } 491 + 492 + if (!(irq_status & ADIN1300_INT_LINK_STAT_CHNG_EN)) 493 + return IRQ_NONE; 494 + 495 + phy_trigger_machine(phydev); 496 + 497 + return IRQ_HANDLED; 498 + } 499 + 482 500 static int adin_cl45_to_adin_reg(struct phy_device *phydev, int devad, 483 501 u16 cl45_regnum) 484 502 { ··· 897 879 .set_tunable = adin_set_tunable, 898 880 .ack_interrupt = adin_phy_ack_intr, 899 881 .config_intr = adin_phy_config_intr, 882 + .handle_interrupt = adin_phy_handle_interrupt, 900 883 .get_sset_count = adin_get_sset_count, 901 884 .get_strings = adin_get_strings, 902 885 .get_stats = adin_get_stats, ··· 921 902 .set_tunable = adin_set_tunable, 922 903 .ack_interrupt = adin_phy_ack_intr, 923 904 .config_intr = adin_phy_config_intr, 905 + .handle_interrupt = adin_phy_handle_interrupt, 924 906 .get_sset_count = adin_get_sset_count, 925 907 .get_strings = adin_get_strings, 926 908 .get_stats = adin_get_stats,