net: phy: meson-gxl: remove the use of .ack_callback()

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.

Cc: Jerome Brunet <jbrunet@baylibre.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Ioana Ciornei 2020-11-23 17:38:08 +02:00 committed by Jakub Kicinski
parent 6719e2be0f
commit 84c8f773d2
1 changed files with 11 additions and 8 deletions

View File

@ -204,22 +204,27 @@ static int meson_gxl_config_intr(struct phy_device *phydev)
int ret; int ret;
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
/* Ack any pending IRQ */
ret = meson_gxl_ack_interrupt(phydev);
if (ret)
return ret;
val = INTSRC_ANEG_PR val = INTSRC_ANEG_PR
| INTSRC_PARALLEL_FAULT | INTSRC_PARALLEL_FAULT
| INTSRC_ANEG_LP_ACK | INTSRC_ANEG_LP_ACK
| INTSRC_LINK_DOWN | INTSRC_LINK_DOWN
| INTSRC_REMOTE_FAULT | INTSRC_REMOTE_FAULT
| INTSRC_ANEG_COMPLETE; | INTSRC_ANEG_COMPLETE;
ret = phy_write(phydev, INTSRC_MASK, val);
} else { } else {
val = 0; val = 0;
ret = phy_write(phydev, INTSRC_MASK, val);
/* Ack any pending IRQ */
ret = meson_gxl_ack_interrupt(phydev);
} }
/* Ack any pending IRQ */ return ret;
ret = meson_gxl_ack_interrupt(phydev);
if (ret)
return ret;
return phy_write(phydev, INTSRC_MASK, val);
} }
static irqreturn_t meson_gxl_handle_interrupt(struct phy_device *phydev) static irqreturn_t meson_gxl_handle_interrupt(struct phy_device *phydev)
@ -249,7 +254,6 @@ static struct phy_driver meson_gxl_phy[] = {
.soft_reset = genphy_soft_reset, .soft_reset = genphy_soft_reset,
.config_init = meson_gxl_config_init, .config_init = meson_gxl_config_init,
.read_status = meson_gxl_read_status, .read_status = meson_gxl_read_status,
.ack_interrupt = meson_gxl_ack_interrupt,
.config_intr = meson_gxl_config_intr, .config_intr = meson_gxl_config_intr,
.handle_interrupt = meson_gxl_handle_interrupt, .handle_interrupt = meson_gxl_handle_interrupt,
.suspend = genphy_suspend, .suspend = genphy_suspend,
@ -260,7 +264,6 @@ static struct phy_driver meson_gxl_phy[] = {
/* PHY_BASIC_FEATURES */ /* PHY_BASIC_FEATURES */
.flags = PHY_IS_INTERNAL, .flags = PHY_IS_INTERNAL,
.soft_reset = genphy_soft_reset, .soft_reset = genphy_soft_reset,
.ack_interrupt = meson_gxl_ack_interrupt,
.config_intr = meson_gxl_config_intr, .config_intr = meson_gxl_config_intr,
.handle_interrupt = meson_gxl_handle_interrupt, .handle_interrupt = meson_gxl_handle_interrupt,
.suspend = genphy_suspend, .suspend = genphy_suspend,