summaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2013-11-15 06:23:32 +0000
committerGrant Likely <grant.likely@linaro.org>2014-02-03 14:19:39 +0000
commitcf4c9eb5a451ba26246477dd3168e98b7a5c1b1c (patch)
tree5b45e915c35cd6b0a12305d74e15fda9f61c2c7f /drivers/of
parentf5fab57dc99eeb01bf09a4262cb4bab786ccffb2 (diff)
downloadlinux-cf4c9eb5a451ba26246477dd3168e98b7a5c1b1c.tar.bz2
of: make of_get_phy_mode parse 'phy-connection-type'
Per the ePAPR v1.1 specification, 'phy-connection-type' is the canonical property name for describing an Ethernet to PHY connection type. Make sure that of_get_phy_mode() also attempts to parse that property and update the comments mentioning 'phy-mode' to also include 'phy-connection-type'. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/of_net.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/of/of_net.c b/drivers/of/of_net.c
index a208a457558c..a3df3428dac6 100644
--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
@@ -13,8 +13,8 @@
/**
* It maps 'enum phy_interface_t' found in include/linux/phy.h
- * into the device tree binding of 'phy-mode', so that Ethernet
- * device driver can get phy interface from device tree.
+ * into the device tree binding of 'phy-mode' or 'phy-connection-type',
+ * so that Ethernet device driver can get phy interface from device tree.
*/
static const char *phy_modes[] = {
[PHY_INTERFACE_MODE_NA] = "",
@@ -37,8 +37,9 @@ static const char *phy_modes[] = {
* of_get_phy_mode - Get phy mode for given device_node
* @np: Pointer to the given device_node
*
- * The function gets phy interface string from property 'phy-mode',
- * and return its index in phy_modes table, or errno in error case.
+ * The function gets phy interface string from property 'phy-mode' or
+ * 'phy-connection-type', and return its index in phy_modes table, or errno in
+ * error case.
*/
int of_get_phy_mode(struct device_node *np)
{
@@ -47,6 +48,8 @@ int of_get_phy_mode(struct device_node *np)
err = of_property_read_string(np, "phy-mode", &pm);
if (err < 0)
+ err = of_property_read_string(np, "phy-connection-type", &pm);
+ if (err < 0)
return err;
for (i = 0; i < ARRAY_SIZE(phy_modes); i++)