lkml.org 
[lkml]   [2023]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 3/3] RFC: net: dsa: mv88e6xxx: Register mdio-external
Make it legal to have a subnode just named "mdio-external"
and have that be recognized immediately as the external
MDIO bus, register it and return. Only fallback to the
old method with a compatible in the external bus node
if this doesn't work.

This is the result of deprecating the old DT method
of providing a node "mdio1" with a compatible string.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/net/dsa/mv88e6xxx/chip.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 52a99d8bada0..05f6776885f6 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3676,7 +3676,21 @@ static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip)
if (err)
return err;

- /* Walk the device tree, and see if there are any other nodes
+ /* If the optional external bus is explicitly named as such,
+ * just register it and be done with this.
+ */
+ child = of_get_child_by_name(np, "mdio-external");
+ if (child) {
+ err = mv88e6xxx_mdio_register(chip, child, true);
+ of_node_put(child);
+ if (err)
+ return err;
+ return 0;
+ }
+
+ /* Deprecated binding with compatible:
+ *
+ * Walk the device tree, and see if there are any other nodes
* which say they are compatible with the external mdio
* bus.
*/
--
2.41.0

\
 
 \ /
  Last update: 2023-10-13 00:36    [W:0.093 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site