Skip to content

Commit fea8ee4

Browse files
HoratiuVulturmanikandan-m11
authored andcommitted
net: micrel: Fix lan8841_config_intr after getting out of sleep mode
When the interrupt is enabled, the function lan8841_config_intr tries to clear any pending interrupts by reading the interrupt status, then checks the return value for errors and then continue to enable the interrupt. It has been seen that once the system gets out of sleep mode, the interrupt status has the value 0x400 meaning that the PHY detected that the link was in low power. That is correct value but the problem is that the check is wrong. We try to check for errors but we return an error also in this case which is not an error. Therefore fix this by returning only when there is an error. Fixes: a8f1a19 ("net: micrel: Add support for lan8841 PHY") Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
1 parent aa33c21 commit fea8ee4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/phy/micrel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3414,7 +3414,7 @@ static int lan8841_config_intr(struct phy_device *phydev)
34143414

34153415
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
34163416
err = phy_read(phydev, LAN8814_INTS);
3417-
if (err)
3417+
if (err < 0)
34183418
return err;
34193419

34203420
/* Enable / disable interrupts. It is OK to enable PTP interrupt

0 commit comments

Comments
 (0)