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", ®))
continue;
+ if (!of_device_is_available(node))
+ continue;
+
if (reg == port1)
return node;
}
--
2.34.1