diff mbox series

[v1] usb: dwc3: drd: Defer probe if extcon device is not found

Message ID 20190218132631.80196-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Mainlined
Commit 98bba546e82d7785b9560c6b141b73ac8d3d820f
Headers show
Series [v1] usb: dwc3: drd: Defer probe if extcon device is not found | expand

Commit Message

Andy Shevchenko Feb. 18, 2019, 1:26 p.m. UTC
In case the "linux,extcon-name" property is defined but device itself
is not ready, defer the probe.

Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---

This is a missed part of the v2 [1] of the commit 268784ba14a7

    ("usb: dwc3: drd: Add support for DR detection through extcon")

which seems to be v1 mistakenly applied.

Greg, it would be good to have this appended to v5.0 release,
if it's not too late.

[1]: https://patchwork.kernel.org/patch/10684311/

 drivers/usb/dwc3/drd.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Greg KH Feb. 19, 2019, 1:25 p.m. UTC | #1
On Mon, Feb 18, 2019 at 03:26:31PM +0200, Andy Shevchenko wrote:
> In case the "linux,extcon-name" property is defined but device itself
> is not ready, defer the probe.
> 
> Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> 
> This is a missed part of the v2 [1] of the commit 268784ba14a7
> 
>     ("usb: dwc3: drd: Add support for DR detection through extcon")
> 
> which seems to be v1 mistakenly applied.
> 
> Greg, it would be good to have this appended to v5.0 release,
> if it's not too late.
> 
> [1]: https://patchwork.kernel.org/patch/10684311/

If I can get an ack from Felipe, I can queue it up.

thanks,

greg k-h
Felipe Balbi Feb. 19, 2019, 1:44 p.m. UTC | #2
Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:

> On Mon, Feb 18, 2019 at 03:26:31PM +0200, Andy Shevchenko wrote:
>> In case the "linux,extcon-name" property is defined but device itself
>> is not ready, defer the probe.
>> 
>> Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> ---
>> 
>> This is a missed part of the v2 [1] of the commit 268784ba14a7
>> 
>>     ("usb: dwc3: drd: Add support for DR detection through extcon")
>> 
>> which seems to be v1 mistakenly applied.
>> 
>> Greg, it would be good to have this appended to v5.0 release,
>> if it's not too late.
>> 
>> [1]: https://patchwork.kernel.org/patch/10684311/
>
> If I can get an ack from Felipe, I can queue it up.

Sure thing:

Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>

Thanks for picking this outside the pull request.
diff mbox series

Patch

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);