]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: rswitch: Do not register disabled ports as ethernet devices
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Sat, 21 Dec 2024 21:48:19 +0000 (22:48 +0100)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Sun, 22 Dec 2024 21:34:32 +0000 (22:34 +0100)
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@mailbox.org>
drivers/net/rswitch.c

index 97b5d1b75c1ea4128dd0e1333582a85a9c42457a..57eff748c900991173c3fc940dc33cf578e8bac9 100644 (file)
@@ -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);