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

net: phy: adin: remove the use of the .ack_interrupt()

In preparation of removing the .ack_interrupt() callback, we must replace
its occurrences (aka phy_clear_interrupt), from the 2 places where it is
called from (phy_enable_interrupts and phy_disable_interrupts), with
equivalent functionality.

This means that clearing interrupts now becomes something that the PHY
driver is responsible of doing, before enabling interrupts and after
clearing them. Make this driver follow the new contract.

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
1d8300d3 66d7439e

+18 -7
+18 -7
drivers/net/phy/adin.c
··· 471 471 472 472 static int adin_phy_config_intr(struct phy_device *phydev) 473 473 { 474 - if (phydev->interrupts == PHY_INTERRUPT_ENABLED) 475 - return phy_set_bits(phydev, ADIN1300_INT_MASK_REG, 476 - ADIN1300_INT_MASK_EN); 474 + int err; 477 475 478 - return phy_clear_bits(phydev, ADIN1300_INT_MASK_REG, 479 - ADIN1300_INT_MASK_EN); 476 + if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { 477 + err = adin_phy_ack_intr(phydev); 478 + if (err) 479 + return err; 480 + 481 + err = phy_set_bits(phydev, ADIN1300_INT_MASK_REG, 482 + ADIN1300_INT_MASK_EN); 483 + } else { 484 + err = phy_clear_bits(phydev, ADIN1300_INT_MASK_REG, 485 + ADIN1300_INT_MASK_EN); 486 + if (err) 487 + return err; 488 + 489 + err = adin_phy_ack_intr(phydev); 490 + } 491 + 492 + return err; 480 493 } 481 494 482 495 static irqreturn_t adin_phy_handle_interrupt(struct phy_device *phydev) ··· 908 895 .read_status = adin_read_status, 909 896 .get_tunable = adin_get_tunable, 910 897 .set_tunable = adin_set_tunable, 911 - .ack_interrupt = adin_phy_ack_intr, 912 898 .config_intr = adin_phy_config_intr, 913 899 .handle_interrupt = adin_phy_handle_interrupt, 914 900 .get_sset_count = adin_get_sset_count, ··· 931 919 .read_status = adin_read_status, 932 920 .get_tunable = adin_get_tunable, 933 921 .set_tunable = adin_set_tunable, 934 - .ack_interrupt = adin_phy_ack_intr, 935 922 .config_intr = adin_phy_config_intr, 936 923 .handle_interrupt = adin_phy_handle_interrupt, 937 924 .get_sset_count = adin_get_sset_count,