summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrizio Castro <fabrizio.castro@bp.renesas.com>2019-03-01 06:05:45 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-19 09:57:32 -0400
commit238e0268c82789e4c107a37045d529a6dbce51a9 (patch)
tree01210a392924cbd12438147dbe4e0f786a56e333
parent976daf9d1199932df80e7b04546d1a1bd4ed5ece (diff)
usb: common: Consider only available nodes for dr_mode
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: 98bfb3946695 ("usb: of: add an api to get dr_mode by the phy node") Cc: stable@vger.kernel.org # v4.4+ Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/common/common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c
index 48277bbc15e4..73c8e6591746 100644
--- a/drivers/usb/common/common.c
+++ b/drivers/usb/common/common.c
@@ -145,6 +145,8 @@ enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0)
145 145
146 do { 146 do {
147 controller = of_find_node_with_property(controller, "phys"); 147 controller = of_find_node_with_property(controller, "phys");
148 if (!of_device_is_available(controller))
149 continue;
148 index = 0; 150 index = 0;
149 do { 151 do {
150 if (arg0 == -1) { 152 if (arg0 == -1) {