1 From 2adc960ce79d3231b02f820daeee434542fe2911 Mon Sep 17 00:00:00 2001
2 From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
3 Date: Tue, 27 Sep 2022 18:53:31 +0300
4 Subject: Revert "USB: fixup for merge issue with "usb: dwc3: Don't switch OTG -> peripheral if extcon is present""
6 From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
8 commit 2adc960ce79d3231b02f820daeee434542fe2911 upstream.
10 This reverts commit 8bd6b8c4b1009d7d2662138d6bdc6fe58a9274c5.
12 Prerequisite revert for the reverting of the original commit 0f0101719138.
14 Fixes: 8bd6b8c4b100 ("USB: fixup for merge issue with "usb: dwc3: Don't switch OTG -> peripheral if extcon is present"")
15 Fixes: 0f0101719138 ("usb: dwc3: Don't switch OTG -> peripheral if extcon is present")
16 Reported-by: Ferry Toth <fntoth@gmail.com>
17 Cc: stable@vger.kernel.org
18 Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
19 Tested-by: Ferry Toth <fntoth@gmail.com> # for Merrifield
20 Link: https://lore.kernel.org/r/20220927155332.10762-2-andriy.shevchenko@linux.intel.com
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23 drivers/usb/dwc3/core.c | 9 +++++++--
24 1 file changed, 7 insertions(+), 2 deletions(-)
26 --- a/drivers/usb/dwc3/core.c
27 +++ b/drivers/usb/dwc3/core.c
28 @@ -1650,8 +1650,13 @@ static struct extcon_dev *dwc3_get_extco
29 * This device property is for kernel internal use only and
30 * is expected to be set by the glue code.
32 - if (device_property_read_string(dev, "linux,extcon-name", &name) == 0)
33 - return extcon_get_extcon_dev(name);
34 + if (device_property_read_string(dev, "linux,extcon-name", &name) == 0) {
35 + edev = extcon_get_extcon_dev(name);
37 + return ERR_PTR(-EPROBE_DEFER);
43 * Try to get an extcon device from the USB PHY controller's "port"