diff options
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/of_net.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/drivers/of/of_net.c b/drivers/of/of_net.c index a208a457558c..84215c1929c4 100644 --- a/drivers/of/of_net.c +++ b/drivers/of/of_net.c | |||
@@ -12,28 +12,6 @@ | |||
12 | #include <linux/export.h> | 12 | #include <linux/export.h> |
13 | 13 | ||
14 | /** | 14 | /** |
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 | ||
17 | * device driver can get phy interface from device tree. | ||
18 | */ | ||
19 | static const char *phy_modes[] = { | ||
20 | [PHY_INTERFACE_MODE_NA] = "", | ||
21 | [PHY_INTERFACE_MODE_MII] = "mii", | ||
22 | [PHY_INTERFACE_MODE_GMII] = "gmii", | ||
23 | [PHY_INTERFACE_MODE_SGMII] = "sgmii", | ||
24 | [PHY_INTERFACE_MODE_TBI] = "tbi", | ||
25 | [PHY_INTERFACE_MODE_REVMII] = "rev-mii", | ||
26 | [PHY_INTERFACE_MODE_RMII] = "rmii", | ||
27 | [PHY_INTERFACE_MODE_RGMII] = "rgmii", | ||
28 | [PHY_INTERFACE_MODE_RGMII_ID] = "rgmii-id", | ||
29 | [PHY_INTERFACE_MODE_RGMII_RXID] = "rgmii-rxid", | ||
30 | [PHY_INTERFACE_MODE_RGMII_TXID] = "rgmii-txid", | ||
31 | [PHY_INTERFACE_MODE_RTBI] = "rtbi", | ||
32 | [PHY_INTERFACE_MODE_SMII] = "smii", | ||
33 | [PHY_INTERFACE_MODE_XGMII] = "xgmii", | ||
34 | }; | ||
35 | |||
36 | /** | ||
37 | * of_get_phy_mode - Get phy mode for given device_node | 15 | * of_get_phy_mode - Get phy mode for given device_node |
38 | * @np: Pointer to the given device_node | 16 | * @np: Pointer to the given device_node |
39 | * | 17 | * |
@@ -49,8 +27,8 @@ int of_get_phy_mode(struct device_node *np) | |||
49 | if (err < 0) | 27 | if (err < 0) |
50 | return err; | 28 | return err; |
51 | 29 | ||
52 | for (i = 0; i < ARRAY_SIZE(phy_modes); i++) | 30 | for (i = 0; i < PHY_INTERFACE_MODE_MAX; i++) |
53 | if (!strcasecmp(pm, phy_modes[i])) | 31 | if (!strcasecmp(pm, phy_modes(i))) |
54 | return i; | 32 | return i; |
55 | 33 | ||
56 | return -ENODEV; | 34 | return -ENODEV; |