summaryrefslogtreecommitdiff
path: root/include/linux/phy.h
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2025-06-14 22:31:57 +0200
committerJakub Kicinski <kuba@kernel.org>2025-06-16 18:15:16 -0700
commit59e74c92e67e2951d829f9b0d78c5dc1df7c4c88 (patch)
tree0e640b71221605d2c6008b641edc2cd19ce60628 /include/linux/phy.h
parent2796ff1e3dcae7a3568f8e428ec9d32a8ee2fb36 (diff)
downloadlinux-next-59e74c92e67e2951d829f9b0d78c5dc1df7c4c88.tar.gz
linux-next-59e74c92e67e2951d829f9b0d78c5dc1df7c4c88.zip
net: phy: improve phy_driver_is_genphy
Use new flag phydev->is_genphy_driven to simplify this function. Note that this includes a minor functional change: Now this function returns true if ANY of the genphy drivers is bound to the PHY device. We have only one user in DSA driver mt7530, and there the functional change doesn't matter. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://patch.msgid.link/c9ac3a7d-262a-425d-9153-97fe3ca6280a@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r--include/linux/phy.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 32ed27f10639..97a09e5743ef 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1296,6 +1296,17 @@ static inline bool phy_is_started(struct phy_device *phydev)
}
/**
+ * phy_driver_is_genphy - Convenience function to check whether PHY is driven
+ * by one of the generic PHY drivers
+ * @phydev: The phy_device struct
+ * Return: true if PHY is driven by one of the genphy drivers
+ */
+static inline bool phy_driver_is_genphy(struct phy_device *phydev)
+{
+ return phydev->is_genphy_driven;
+}
+
+/**
* phy_disable_eee_mode - Don't advertise an EEE mode.
* @phydev: The phy_device struct
* @link_mode: The EEE mode to be disabled
@@ -2097,7 +2108,6 @@ module_exit(phy_module_exit)
#define module_phy_driver(__phy_drivers) \
phy_module_driver(__phy_drivers, ARRAY_SIZE(__phy_drivers))
-bool phy_driver_is_genphy(struct phy_device *phydev);
bool phy_driver_is_genphy_10g(struct phy_device *phydev);
#endif /* __PHY_H */