Skip to contentSkip to conversation

dt/net: add helper function of_get_phy_mode

PATCH Nicolas Ferre 1 participant 1 message Nov 21, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi all,

Quoted 8 lines

It adds the helper function of_get_phy_mode getting phy interface from device tree.

Signed-off-by Shawn Guo <shawn.guo <at> linaro.org>
Cc Grant Likely <grant.likely <at> secretlab.ca>
---
 drivers/of/of_net.c    |   43 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/of_net.h |    1 +

[..]

Quoted 1 line

+const int of_get_phy_mode(struct device_node *np)

Nice helper function, indeed.

Review

Quoted 5 lines
(quoted diff) +5 -0
+{
+	const char *pm;
+	int err, i;
+
+	err = of_property_read_string(np, "phy-mode", &pm);

Just a quick question about the use of the "phy-mode" string:
- I know that it is widely used in drivers
- but, I discovered that in the ePAPR the string mentioned is "phy-connection-type" (6.5.2.2)
- and it is true also that in the very same document, we find the "phy-mode" in the Appendix B1 example...

Why this naming is not consistent (even in ePAPR)?

Best regards,

Signature · 1 line
Nicolas Ferre