Add helpers to make locking/unlocking the MDIO bus easier.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -1076,6 +1076,16 @@ static inline const char *phydev_name(const struct phy_device *phydev) · 1075 unmodified lines | ||
| 1076 | 1076 | return dev_name(&phydev->mdio.dev); |
| 1077 | 1077 | } |
| 1078 | 1078 | |
| 1079 | +static inline void phy_lock_mdio_bus(struct phy_device *phydev) | |
| 1080 | +{ | |
| 1081 | + mutex_lock(&phydev->mdio.bus->mdio_lock); | |
| 1082 | +} | |
| 1083 | + | |
| 1084 | +static inline void phy_unlock_mdio_bus(struct phy_device *phydev) | |
| 1085 | +{ | |
| 1086 | + mutex_unlock(&phydev->mdio.bus->mdio_lock); | |
| 1087 | +} | |
| 1088 | + | |
| 1079 | 1089 | void phy_attached_print(struct phy_device *phydev, const char *fmt, ...) |
| 1080 | 1090 | __printf(2, 3); |
| 1081 | 1091 | void phy_attached_info(struct phy_device *phydev); |