Skip to content

Commit

Permalink
net: phy: amd: 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 17, 2020
1 parent d995a36 commit 347917c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions drivers/net/phy/amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,19 @@ static int am79c_config_intr(struct phy_device *phydev)
{
int err;

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

err = phy_write(phydev, MII_AM79C_IR, MII_AM79C_IR_IMASK_INIT);
else
} else {
err = phy_write(phydev, MII_AM79C_IR, 0);
if (err)
return err;

err = am79c_ack_interrupt(phydev);
}

return err;
}
Expand Down Expand Up @@ -84,7 +93,6 @@ static struct phy_driver am79c_driver[] = { {
.phy_id_mask = 0xfffffff0,
/* PHY_BASIC_FEATURES */
.config_init = am79c_config_init,
.ack_interrupt = am79c_ack_interrupt,
.config_intr = am79c_config_intr,
.handle_interrupt = am79c_handle_interrupt,
} };
Expand Down

0 comments on commit 347917c

Please sign in to comment.