[PATCH] USB: of: filter disabled device node

Zhengqiao Xia posted 1 patch 1 week, 3 days ago
There is a newer version of this series
drivers/usb/core/of.c | 3 +++
1 file changed, 3 insertions(+)
[PATCH] USB: of: filter disabled device node
Posted by Zhengqiao Xia 1 week, 3 days ago
We should not point the of_node of a USB device to a disabled devicetree
node. Otherwise, the interface under this USB device will not be able
to register.

Signed-off-by: Zhengqiao Xia <xiazhengqiao@huaqin.corp-partner.google.com>
---
 drivers/usb/core/of.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/core/of.c b/drivers/usb/core/of.c
index 763e4122ed5b3..6bb577e711811 100644
--- a/drivers/usb/core/of.c
+++ b/drivers/usb/core/of.c
@@ -31,6 +31,9 @@ struct device_node *usb_of_get_device_node(struct usb_device *hub, int port1)
 		if (of_property_read_u32(node, "reg", &reg))
 			continue;
 
+		if (!of_device_is_available(node))
+			continue;
+
 		if (reg == port1)
 			return node;
 	}
-- 
2.34.1
Re: [PATCH] USB: of: filter disabled device node
Posted by Greg KH 1 week, 3 days ago
On Fri, Nov 21, 2025 at 04:09:05PM +0800, Zhengqiao Xia wrote:
> We should not point the of_node of a USB device to a disabled devicetree
> node. Otherwise, the interface under this USB device will not be able
> to register.

What changed to require this?  What commit id does this fix?

And what devices have a disabled devicetree node?

> Signed-off-by: Zhengqiao Xia <xiazhengqiao@huaqin.corp-partner.google.com>

Please use a real email address, "corp-partner.google.com" is not "real"
:)

thanks,

greg k-h