[PATCH] net: rswitch: Do not register disabled ports as ethernet devices

Marek Vasut marek.vasut+renesas at mailbox.org
Sat Dec 21 22:48:19 CET 2024


In case an rswitch port is described as disabled in DT, do not
register it as ethernet device in U-Boot. This way, such ports
cannot be accessed from U-Boot command line.

Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
---
Cc: Enric Balletbo i Serra <eballetb at redhat.com>
Cc: Joe Hershberger <joe.hershberger at ni.com>
Cc: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
Cc: Ramon Fried <rfried.dev at gmail.com>
Cc: Tom Rini <trini at konsulko.com>
Cc: u-boot at lists.denx.de
---
 drivers/net/rswitch.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/rswitch.c b/drivers/net/rswitch.c
index 97b5d1b75c1..57eff748c90 100644
--- a/drivers/net/rswitch.c
+++ b/drivers/net/rswitch.c
@@ -1113,6 +1113,9 @@ static int rswitch_bind(struct udevice *parent)
 		return -ENOENT;
 
 	ofnode_for_each_subnode(node, ports_np) {
+		if (!ofnode_is_enabled(node))
+			continue;
+
 		ret = device_bind_with_driver_data(parent, drv,
 						   ofnode_get_name(node),
 						   (ulong)priv, node, &dev);
-- 
2.45.2



More information about the U-Boot mailing list