Commit e96a0d97 authored by Ioana Ciornei's avatar Ioana Ciornei Committed by Jakub Kicinski

net: phy: vitesse: 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.

Cc: Kavya Sree Kotagiri <kavyasree.kotagiri@microchip.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b606ad8f
...@@ -275,25 +275,14 @@ static int vsc8601_config_init(struct phy_device *phydev) ...@@ -275,25 +275,14 @@ static int vsc8601_config_init(struct phy_device *phydev)
return 0; return 0;
} }
static int vsc824x_ack_interrupt(struct phy_device *phydev)
{
int err = 0;
/* Don't bother to ACK the interrupts if interrupts
* are disabled. The 824x cannot clear the interrupts
* if they are disabled.
*/
if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
err = phy_read(phydev, MII_VSC8244_ISTAT);
return (err < 0) ? err : 0;
}
static int vsc82xx_config_intr(struct phy_device *phydev) static int vsc82xx_config_intr(struct phy_device *phydev)
{ {
int err; int err;
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
/* Don't bother to ACK the interrupts since the 824x cannot
* clear the interrupts if they are disabled.
*/
err = phy_write(phydev, MII_VSC8244_IMASK, err = phy_write(phydev, MII_VSC8244_IMASK,
(phydev->drv->phy_id == PHY_ID_VSC8234 || (phydev->drv->phy_id == PHY_ID_VSC8234 ||
phydev->drv->phy_id == PHY_ID_VSC8244 || phydev->drv->phy_id == PHY_ID_VSC8244 ||
...@@ -420,7 +409,6 @@ static struct phy_driver vsc82xx_driver[] = { ...@@ -420,7 +409,6 @@ static struct phy_driver vsc82xx_driver[] = {
/* PHY_GBIT_FEATURES */ /* PHY_GBIT_FEATURES */
.config_init = &vsc824x_config_init, .config_init = &vsc824x_config_init,
.config_aneg = &vsc82x4_config_aneg, .config_aneg = &vsc82x4_config_aneg,
.ack_interrupt = &vsc824x_ack_interrupt,
.config_intr = &vsc82xx_config_intr, .config_intr = &vsc82xx_config_intr,
.handle_interrupt = &vsc82xx_handle_interrupt, .handle_interrupt = &vsc82xx_handle_interrupt,
}, { }, {
...@@ -430,7 +418,6 @@ static struct phy_driver vsc82xx_driver[] = { ...@@ -430,7 +418,6 @@ static struct phy_driver vsc82xx_driver[] = {
/* PHY_GBIT_FEATURES */ /* PHY_GBIT_FEATURES */
.config_init = &vsc824x_config_init, .config_init = &vsc824x_config_init,
.config_aneg = &vsc82x4_config_aneg, .config_aneg = &vsc82x4_config_aneg,
.ack_interrupt = &vsc824x_ack_interrupt,
.config_intr = &vsc82xx_config_intr, .config_intr = &vsc82xx_config_intr,
.handle_interrupt = &vsc82xx_handle_interrupt, .handle_interrupt = &vsc82xx_handle_interrupt,
}, { }, {
...@@ -440,7 +427,6 @@ static struct phy_driver vsc82xx_driver[] = { ...@@ -440,7 +427,6 @@ static struct phy_driver vsc82xx_driver[] = {
/* PHY_GBIT_FEATURES */ /* PHY_GBIT_FEATURES */
.config_init = &vsc824x_config_init, .config_init = &vsc824x_config_init,
.config_aneg = &vsc82x4_config_aneg, .config_aneg = &vsc82x4_config_aneg,
.ack_interrupt = &vsc824x_ack_interrupt,
.config_intr = &vsc82xx_config_intr, .config_intr = &vsc82xx_config_intr,
.handle_interrupt = &vsc82xx_handle_interrupt, .handle_interrupt = &vsc82xx_handle_interrupt,
}, { }, {
...@@ -449,7 +435,6 @@ static struct phy_driver vsc82xx_driver[] = { ...@@ -449,7 +435,6 @@ static struct phy_driver vsc82xx_driver[] = {
.phy_id_mask = 0x000ffff0, .phy_id_mask = 0x000ffff0,
/* PHY_GBIT_FEATURES */ /* PHY_GBIT_FEATURES */
.config_init = &vsc8601_config_init, .config_init = &vsc8601_config_init,
.ack_interrupt = &vsc824x_ack_interrupt,
.config_intr = &vsc82xx_config_intr, .config_intr = &vsc82xx_config_intr,
.handle_interrupt = &vsc82xx_handle_interrupt, .handle_interrupt = &vsc82xx_handle_interrupt,
}, { }, {
...@@ -495,7 +480,6 @@ static struct phy_driver vsc82xx_driver[] = { ...@@ -495,7 +480,6 @@ static struct phy_driver vsc82xx_driver[] = {
/* PHY_GBIT_FEATURES */ /* PHY_GBIT_FEATURES */
.config_init = &vsc824x_config_init, .config_init = &vsc824x_config_init,
.config_aneg = &vsc82x4_config_aneg, .config_aneg = &vsc82x4_config_aneg,
.ack_interrupt = &vsc824x_ack_interrupt,
.config_intr = &vsc82xx_config_intr, .config_intr = &vsc82xx_config_intr,
.handle_interrupt = &vsc82xx_handle_interrupt, .handle_interrupt = &vsc82xx_handle_interrupt,
}, { }, {
...@@ -505,7 +489,6 @@ static struct phy_driver vsc82xx_driver[] = { ...@@ -505,7 +489,6 @@ static struct phy_driver vsc82xx_driver[] = {
.name = "Vitesse VSC8221", .name = "Vitesse VSC8221",
/* PHY_GBIT_FEATURES */ /* PHY_GBIT_FEATURES */
.config_init = &vsc8221_config_init, .config_init = &vsc8221_config_init,
.ack_interrupt = &vsc824x_ack_interrupt,
.config_intr = &vsc82xx_config_intr, .config_intr = &vsc82xx_config_intr,
.handle_interrupt = &vsc82xx_handle_interrupt, .handle_interrupt = &vsc82xx_handle_interrupt,
}, { }, {
...@@ -515,7 +498,6 @@ static struct phy_driver vsc82xx_driver[] = { ...@@ -515,7 +498,6 @@ static struct phy_driver vsc82xx_driver[] = {
.name = "Vitesse VSC8211", .name = "Vitesse VSC8211",
/* PHY_GBIT_FEATURES */ /* PHY_GBIT_FEATURES */
.config_init = &vsc8221_config_init, .config_init = &vsc8221_config_init,
.ack_interrupt = &vsc824x_ack_interrupt,
.config_intr = &vsc82xx_config_intr, .config_intr = &vsc82xx_config_intr,
.handle_interrupt = &vsc82xx_handle_interrupt, .handle_interrupt = &vsc82xx_handle_interrupt,
} }; } };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment