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

net: phy: cicada: remove the use of .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>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Ioana Ciornei and committed by
Jakub Kicinski
a758087f e5d2b0b6

+11 -4
+11 -4
drivers/net/phy/cicada.c
··· 87 87 { 88 88 int err; 89 89 90 - if (phydev->interrupts == PHY_INTERRUPT_ENABLED) 90 + if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { 91 + err = cis820x_ack_interrupt(phydev); 92 + if (err) 93 + return err; 94 + 91 95 err = phy_write(phydev, MII_CIS8201_IMASK, 92 96 MII_CIS8201_IMASK_MASK); 93 - else 97 + } else { 94 98 err = phy_write(phydev, MII_CIS8201_IMASK, 0); 99 + if (err) 100 + return err; 101 + 102 + err = cis820x_ack_interrupt(phydev); 103 + } 95 104 96 105 return err; 97 106 } ··· 131 122 .phy_id_mask = 0x000ffff0, 132 123 /* PHY_GBIT_FEATURES */ 133 124 .config_init = &cis820x_config_init, 134 - .ack_interrupt = &cis820x_ack_interrupt, 135 125 .config_intr = &cis820x_config_intr, 136 126 .handle_interrupt = &cis820x_handle_interrupt, 137 127 }, { ··· 139 131 .phy_id_mask = 0x000fffc0, 140 132 /* PHY_GBIT_FEATURES */ 141 133 .config_init = &cis820x_config_init, 142 - .ack_interrupt = &cis820x_ack_interrupt, 143 134 .config_intr = &cis820x_config_intr, 144 135 .handle_interrupt = &cis820x_handle_interrupt, 145 136 } };