Commit 214c798b authored by Ioana Ciornei's avatar Ioana Ciornei Committed by Jakub Kicinski

net: phy: aquantia: do not return an error on clearing pending IRQs

The referenced commit added in .config_intr() the part of code which upon
configuration of the IRQ state it also clears up any pending IRQ. If
there were actually pending IRQs, a read on the IRQ status register will
return something non zero. This should not result in the callback
returning an error.

Fix this by returning an error only when the result of the
phy_read_mmd() is negative.

Fixes: e11ef96d ("net: phy: aquantia: remove the use of .ack_interrupt()")
Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
Tested-by: default avatarCamelia Groza <camelia.groza@nxp.com>
Link: https://lore.kernel.org/r/20201109154601.3812574-1-ciorneiioana@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 8ed1045b
...@@ -250,7 +250,7 @@ static int aqr_config_intr(struct phy_device *phydev) ...@@ -250,7 +250,7 @@ static int aqr_config_intr(struct phy_device *phydev)
if (en) { if (en) {
/* Clear any pending interrupts before enabling them */ /* Clear any pending interrupts before enabling them */
err = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_STATUS2); err = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_STATUS2);
if (err) if (err < 0)
return err; return err;
} }
...@@ -273,7 +273,7 @@ static int aqr_config_intr(struct phy_device *phydev) ...@@ -273,7 +273,7 @@ static int aqr_config_intr(struct phy_device *phydev)
if (!en) { if (!en) {
/* Clear any pending interrupts after we have disabled them */ /* Clear any pending interrupts after we have disabled them */
err = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_STATUS2); err = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_STATUS2);
if (err) if (err < 0)
return err; return err;
} }
......
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