summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2019-11-23 19:28:37 +0300
committerDavid S. Miller <davem@davemloft.net>2019-11-25 21:47:00 +0300
commitbec170e55982c2d3b8e1beccadf16e288fe6fb5a (patch)
tree70d7ebb004c81710c883dcd3dd91d849d7eeca2f /include
parent4eb47198e955fc01d14113f525b62a4bc95554c7 (diff)
downloadlinux-bec170e55982c2d3b8e1beccadf16e288fe6fb5a.tar.xz
net: phy: add helpers phy_(un)lock_mdio_bus
Add helpers to make locking/unlocking the MDIO bus easier. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/phy.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index f5cdfb206097..5032d453ac66 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1076,6 +1076,16 @@ static inline const char *phydev_name(const struct phy_device *phydev)
return dev_name(&phydev->mdio.dev);
}
+static inline void phy_lock_mdio_bus(struct phy_device *phydev)
+{
+ mutex_lock(&phydev->mdio.bus->mdio_lock);
+}
+
+static inline void phy_unlock_mdio_bus(struct phy_device *phydev)
+{
+ mutex_unlock(&phydev->mdio.bus->mdio_lock);
+}
+
void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)
__printf(2, 3);
void phy_attached_info(struct phy_device *phydev);