Skip to content

Commit

Permalink
net: phy: cicada: remove the use of .ack_interrupt()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ioana Ciornei authored and Jakub Kicinski committed Nov 6, 2020
1 parent e5d2b0b commit a758087
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions drivers/net/phy/cicada.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,20 @@ static int cis820x_config_intr(struct phy_device *phydev)
{
int err;

if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
err = cis820x_ack_interrupt(phydev);
if (err)
return err;

err = phy_write(phydev, MII_CIS8201_IMASK,
MII_CIS8201_IMASK_MASK);
else
} else {
err = phy_write(phydev, MII_CIS8201_IMASK, 0);
if (err)
return err;

err = cis820x_ack_interrupt(phydev);
}

return err;
}
Expand Down Expand Up @@ -122,7 +131,6 @@ static struct phy_driver cis820x_driver[] = {
.phy_id_mask = 0x000ffff0,
/* PHY_GBIT_FEATURES */
.config_init = &cis820x_config_init,
.ack_interrupt = &cis820x_ack_interrupt,
.config_intr = &cis820x_config_intr,
.handle_interrupt = &cis820x_handle_interrupt,
}, {
Expand All @@ -131,7 +139,6 @@ static struct phy_driver cis820x_driver[] = {
.phy_id_mask = 0x000fffc0,
/* PHY_GBIT_FEATURES */
.config_init = &cis820x_config_init,
.ack_interrupt = &cis820x_ack_interrupt,
.config_intr = &cis820x_config_intr,
.handle_interrupt = &cis820x_handle_interrupt,
} };
Expand Down

0 comments on commit a758087

Please sign in to comment.