summaryrefslogtreecommitdiffstats
path: root/include/linux/phy.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r--include/linux/phy.h15
1 files changed, 1 insertions, 14 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 177a330d84e5..bf1070c2a53b 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -676,26 +676,13 @@ size_t phy_speeds(unsigned int *speeds, size_t size,
676void of_set_phy_supported(struct phy_device *phydev); 676void of_set_phy_supported(struct phy_device *phydev);
677void of_set_phy_eee_broken(struct phy_device *phydev); 677void of_set_phy_eee_broken(struct phy_device *phydev);
678 678
679static inline bool __phy_is_started(struct phy_device *phydev)
680{
681 WARN_ON(!mutex_is_locked(&phydev->lock));
682
683 return phydev->state >= PHY_UP;
684}
685
686/** 679/**
687 * phy_is_started - Convenience function to check whether PHY is started 680 * phy_is_started - Convenience function to check whether PHY is started
688 * @phydev: The phy_device struct 681 * @phydev: The phy_device struct
689 */ 682 */
690static inline bool phy_is_started(struct phy_device *phydev) 683static inline bool phy_is_started(struct phy_device *phydev)
691{ 684{
692 bool started; 685 return phydev->state >= PHY_UP;
693
694 mutex_lock(&phydev->lock);
695 started = __phy_is_started(phydev);
696 mutex_unlock(&phydev->lock);
697
698 return started;
699} 686}
700 687
701void phy_resolve_aneg_linkmode(struct phy_device *phydev); 688void phy_resolve_aneg_linkmode(struct phy_device *phydev);