From: Iyappan Subramanian <isubramanian@apm.com>
To: davem@davemloft.net, netdev@vger.kernel.org
Cc: f.fainelli@gmail.com, andrew@lunn.ch,
linux-arm-kernel@lists.infradead.org, patches@apm.com,
Iyappan Subramanian <isubramanian@apm.com>
Subject: [PATCH v2 net-next 1/2] include: linux: Add helper function to check phy interface mode
Date: Thu, 18 May 2017 15:13:43 -0700 [thread overview]
Message-ID: <1495145624-29463-2-git-send-email-isubramanian@apm.com> (raw)
In-Reply-To: <1495145624-29463-1-git-send-email-isubramanian@apm.com>
Added helper function that checks phy_mode is RGMII (all variants)
'bool phy_interface_mode_is_rgmii(phy_interface_t mode)'
Changed the following function, to use the above.
'bool phy_interface_is_rgmii(struct phy_device *phydev)'
Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
Suggested-by: Florian Fainelli <f.fainelli@gmail.com>
Suggested-by: Andrew Lunn <andrew@lunn.ch>
---
include/linux/phy.h | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 54ef458..5a808a2 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);
};
/*
--
1.9.1
next prev parent reply other threads:[~2017-05-18 22:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-18 22:13 [PATCH v2 net-next 0/2] Check all RGMII phy mode variants Iyappan Subramanian
2017-05-18 22:13 ` Iyappan Subramanian [this message]
2017-05-18 22:19 ` [PATCH v2 net-next 1/2] include: linux: Add helper function to check phy interface mode Florian Fainelli
2017-05-19 4:34 ` Iyappan Subramanian
2017-05-18 22:13 ` [PATCH v2 net-next 2/2] drivers: net: xgene: Check all RGMII phy mode variants Iyappan Subramanian
2017-05-19 23:42 ` [PATCH v2 net-next 0/2] " David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1495145624-29463-2-git-send-email-isubramanian@apm.com \
--to=isubramanian@apm.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=patches@apm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox