summaryrefslogtreecommitdiff
path: root/include/linux/phy.h
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2018-07-23 21:40:07 +0200
committerDavid S. Miller <davem@davemloft.net>2018-07-25 13:41:22 -0700
commit3c507b8af638c67d4a80d70091d2057ecb01e8a6 (patch)
tree0faf90171f874daa7937568e4153838dc2265a65 /include/linux/phy.h
parentd805f6a8682937d7f8136fe7561659b13f5aaa49 (diff)
net: phy: add helper phy_polling_mode
Add a helper for checking whether polling is used to detect PHY status changes. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/phy.h')
-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 075c2f770d3e..cd6f637cbbfb 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -825,6 +825,16 @@ static inline bool phy_interrupt_is_valid(struct phy_device *phydev)
}
/**
+ * phy_polling_mode - Convenience function for testing whether polling is
+ * used to detect PHY status changes
+ * @phydev: the phy_device struct
+ */
+static inline bool phy_polling_mode(struct phy_device *phydev)
+{
+ return phydev->irq == PHY_POLL;
+}
+
+/**
* phy_is_internal - Convenience function for testing if a PHY is internal
* @phydev: the phy_device struct
*/