Skip to content

Commit b2b1949

Browse files
committed
Merge branch 'net-phy-remove-phy_error-from-phy_disable_interrupts'
Heiner Kallweit says: ==================== net: phy: remove phy_error from phy_disable_interrupts All callers of phy_disable_interrupts() call phy_error() in the error case. Therefore we don't need to do this within the function too. This change also allows us to use phy_disable_interrupts() in code holding phydev->lock (because phy_error() takes this lock). Make use of this in phy_stop(). v2: - splitted into two separate patches ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 4d1e46a + 70a55c3 commit b2b1949

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

drivers/net/phy/phy.c

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -662,19 +662,10 @@ static int phy_disable_interrupts(struct phy_device *phydev)
662662
/* Disable PHY interrupts */
663663
err = phy_config_interrupt(phydev, PHY_INTERRUPT_DISABLED);
664664
if (err)
665-
goto phy_err;
665+
return err;
666666

667667
/* Clear the interrupt */
668-
err = phy_clear_interrupt(phydev);
669-
if (err)
670-
goto phy_err;
671-
672-
return 0;
673-
674-
phy_err:
675-
phy_error(phydev);
676-
677-
return err;
668+
return phy_clear_interrupt(phydev);
678669
}
679670

680671
/**
@@ -774,13 +765,8 @@ void phy_stop(struct phy_device *phydev)
774765
if (PHY_HALTED == phydev->state)
775766
goto out_unlock;
776767

777-
if (phy_interrupt_is_valid(phydev)) {
778-
/* Disable PHY Interrupts */
779-
phy_config_interrupt(phydev, PHY_INTERRUPT_DISABLED);
780-
781-
/* Clear any pending interrupts */
782-
phy_clear_interrupt(phydev);
783-
}
768+
if (phy_interrupt_is_valid(phydev))
769+
phy_disable_interrupts(phydev);
784770

785771
phydev->state = PHY_HALTED;
786772

0 commit comments

Comments
 (0)