summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2019-02-18 14:26:31 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-19 15:08:07 +0100
commit98bba546e82d7785b9560c6b141b73ac8d3d820f (patch)
tree0dc68d0cc0f110fd27dacfd3a7a665ddf03a85b8 /drivers/usb
parentcdc-wdm: pass return value of recover_from_urb_loss (diff)
downloadlinux-98bba546e82d7785b9560c6b141b73ac8d3d820f.tar.xz
linux-98bba546e82d7785b9560c6b141b73ac8d3d820f.zip
usb: dwc3: drd: Defer probe if extcon device is not found
In case the "linux,extcon-name" property is defined but device itself is not ready, defer the probe. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/dwc3/drd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c
index 869725d15c74..726100d1ac0d 100644
--- a/drivers/usb/dwc3/drd.c
+++ b/drivers/usb/dwc3/drd.c
@@ -457,8 +457,13 @@ static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc)
* This device property is for kernel internal use only and
* is expected to be set by the glue code.
*/
- if (device_property_read_string(dev, "linux,extcon-name", &name) == 0)
- return extcon_get_extcon_dev(name);
+ if (device_property_read_string(dev, "linux,extcon-name", &name) == 0) {
+ edev = extcon_get_extcon_dev(name);
+ if (!edev)
+ return ERR_PTR(-EPROBE_DEFER);
+
+ return edev;
+ }
np_phy = of_parse_phandle(dev->of_node, "phys", 0);
np_conn = of_graph_get_remote_node(np_phy, -1, -1);