Commit 60397a4e authored by Fabrizio Castro's avatar Fabrizio Castro Committed by Greg Kroah-Hartman

usb: common: Consider only available nodes for dr_mode

commit 238e0268c82789e4c107a37045d529a6dbce51a9 upstream.

There are cases where multiple device tree nodes point to the
same phy node by means of the "phys" property, but we should
only consider those nodes that are marked as available rather
than just any node.

Fixes: 98bfb394 ("usb: of: add an api to get dr_mode by the phy node")
Cc: # v4.4+
Signed-off-by: default avatarFabrizio Castro <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 3e043e5d
......@@ -148,6 +148,8 @@ enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0)
do {
controller = of_find_node_with_property(controller, "phys");
if (!of_device_is_available(controller))
index = 0;
do {
if (arg0 == -1) {
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment