diff options
author | Ioana Ciornei <ioana.ciornei@nxp.com> | 2020-11-09 18:46:01 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-11-12 01:09:54 +0300 |
commit | 214c798ba1a4e8ff3355d933a46b8a1f27d9a9e7 (patch) | |
tree | 6849e6f90fef13d449ba99d93290793676339d68 /drivers | |
parent | 8ed1045bb828cd04326369cd66afeb48af2582ac (diff) | |
download | linux-214c798ba1a4e8ff3355d933a46b8a1f27d9a9e7.tar.xz |
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: e11ef96d44f1 ("net: phy: aquantia: remove the use of .ack_interrupt()")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Tested-by: Camelia Groza <camelia.groza@nxp.com>
Link: https://lore.kernel.org/r/20201109154601.3812574-1-ciorneiioana@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/phy/aquantia_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/phy/aquantia_main.c b/drivers/net/phy/aquantia_main.c index 345f70f9d39b..968dd43a2b1e 100644 --- a/drivers/net/phy/aquantia_main.c +++ b/drivers/net/phy/aquantia_main.c @@ -250,7 +250,7 @@ static int aqr_config_intr(struct phy_device *phydev) if (en) { /* Clear any pending interrupts before enabling them */ err = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_STATUS2); - if (err) + if (err < 0) return err; } @@ -273,7 +273,7 @@ static int aqr_config_intr(struct phy_device *phydev) if (!en) { /* Clear any pending interrupts after we have disabled them */ err = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_TX_VEND_INT_STATUS2); - if (err) + if (err < 0) return err; } |