diff options
Diffstat (limited to 'drivers/of/of_net.c')
-rw-r--r-- | drivers/of/of_net.c | 11 |
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 @@ | |||
13 | 13 | ||
14 | /** | 14 | /** |
15 | * It maps 'enum phy_interface_t' found in include/linux/phy.h | 15 | * It maps 'enum phy_interface_t' found in include/linux/phy.h |
16 | * into the device tree binding of 'phy-mode', so that Ethernet | 16 | * into the device tree binding of 'phy-mode' or 'phy-connection-type', |
17 | * device driver can get phy interface from device tree. | 17 | * so that Ethernet device driver can get phy interface from device tree. |
18 | */ | 18 | */ |
19 | static const char *phy_modes[] = { | 19 | static const char *phy_modes[] = { |
20 | [PHY_INTERFACE_MODE_NA] = "", | 20 | [PHY_INTERFACE_MODE_NA] = "", |
@@ -37,8 +37,9 @@ static const char *phy_modes[] = { | |||
37 | * of_get_phy_mode - Get phy mode for given device_node | 37 | * of_get_phy_mode - Get phy mode for given device_node |
38 | * @np: Pointer to the given device_node | 38 | * @np: Pointer to the given device_node |
39 | * | 39 | * |
40 | * The function gets phy interface string from property 'phy-mode', | 40 | * The function gets phy interface string from property 'phy-mode' or |
41 | * and return its index in phy_modes table, or errno in error case. | 41 | * 'phy-connection-type', and return its index in phy_modes table, or errno in |
42 | * error case. | ||
42 | */ | 43 | */ |
43 | int of_get_phy_mode(struct device_node *np) | 44 | int of_get_phy_mode(struct device_node *np) |
44 | { | 45 | { |
@@ -47,6 +48,8 @@ int of_get_phy_mode(struct device_node *np) | |||
47 | 48 | ||
48 | err = of_property_read_string(np, "phy-mode", &pm); | 49 | err = of_property_read_string(np, "phy-mode", &pm); |
49 | if (err < 0) | 50 | if (err < 0) |
51 | err = of_property_read_string(np, "phy-connection-type", &pm); | ||
52 | if (err < 0) | ||
50 | return err; | 53 | return err; |
51 | 54 | ||
52 | for (i = 0; i < ARRAY_SIZE(phy_modes); i++) | 55 | for (i = 0; i < ARRAY_SIZE(phy_modes); i++) |