diff options
| author | David S. Miller <davem@davemloft.net> | 2017-05-20 02:41:45 +0300 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-05-20 02:41:45 +0300 |
| commit | dc57ae3d938f67ea8960e9cf541c93bc0a143148 (patch) | |
| tree | 6f6298fa6aced40f67528f93505c4fab73dad8d7 /include | |
| parent | 5d65a16a689a2973a014f2f5aa04d0e2f7b66403 (diff) | |
| parent | 326dde3e3b2ed05e5882e4401368d0f5d8861da7 (diff) | |
| download | linux-dc57ae3d938f67ea8960e9cf541c93bc0a143148.tar.xz | |
Merge branch 'xgene-check-all-RGMII-phy-mode-variants'
Iyappan Subramanian says:
====================
Check all RGMII phy mode variants
This patch set,
- adds phy_interface_mode_is_rgmii() helper function
- addresses review comment from previous patch set, by calling
phy_interface_mode_is_rgmii() to address all RGMII variants
v2: Address review comments from v1
- adds phy_interface_mode_is_rgmii() helper function
- addresses review comment from previous patch set, by calling
phy_interface_mode_is_rgmii() to address all RGMII variants
v1:
- Initial version
====================
Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/phy.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h index 54ef45823fc1..5a808a26e4cf 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -716,14 +716,24 @@ static inline bool phy_is_internal(struct phy_device *phydev) } /** + * phy_interface_mode_is_rgmii - Convenience function for testing if a + * PHY interface mode is RGMII (all variants) + * @mode: the phy_interface_t enum + */ +static inline bool phy_interface_mode_is_rgmii(phy_interface_t mode) +{ + return mode >= PHY_INTERFACE_MODE_RGMII && + mode <= PHY_INTERFACE_MODE_RGMII_TXID; +}; + +/** * phy_interface_is_rgmii - Convenience function for testing if a PHY interface * is RGMII (all variants) * @phydev: the phy_device struct */ static inline bool phy_interface_is_rgmii(struct phy_device *phydev) { - return phydev->interface >= PHY_INTERFACE_MODE_RGMII && - phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID; + return phy_interface_mode_is_rgmii(phydev->interface); }; /* |
