]>
Commit | Line | Data |
---|---|---|
955d73e0 GKH |
1 | From 238e0268c82789e4c107a37045d529a6dbce51a9 Mon Sep 17 00:00:00 2001 |
2 | From: Fabrizio Castro <fabrizio.castro@bp.renesas.com> | |
3 | Date: Fri, 1 Mar 2019 11:05:45 +0000 | |
4 | Subject: usb: common: Consider only available nodes for dr_mode | |
5 | ||
6 | From: Fabrizio Castro <fabrizio.castro@bp.renesas.com> | |
7 | ||
8 | commit 238e0268c82789e4c107a37045d529a6dbce51a9 upstream. | |
9 | ||
10 | There are cases where multiple device tree nodes point to the | |
11 | same phy node by means of the "phys" property, but we should | |
12 | only consider those nodes that are marked as available rather | |
13 | than just any node. | |
14 | ||
15 | Fixes: 98bfb3946695 ("usb: of: add an api to get dr_mode by the phy node") | |
16 | Cc: stable@vger.kernel.org # v4.4+ | |
17 | Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com> | |
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
19 | ||
20 | --- | |
21 | drivers/usb/common/common.c | 2 ++ | |
22 | 1 file changed, 2 insertions(+) | |
23 | ||
24 | --- a/drivers/usb/common/common.c | |
25 | +++ b/drivers/usb/common/common.c | |
26 | @@ -145,6 +145,8 @@ enum usb_dr_mode of_usb_get_dr_mode_by_p | |
27 | ||
28 | do { | |
29 | controller = of_find_node_with_property(controller, "phys"); | |
30 | + if (!of_device_is_available(controller)) | |
31 | + continue; | |
32 | index = 0; | |
33 | do { | |
34 | if (arg0 == -1) { |