diff mbox

usb: gadget: remove driver from pending list on probe error

Message ID 1454935334-2678-1-git-send-email-m.szyprowski@samsung.com
State Accepted
Commit 31b994a4986dcdd664c597afcef2c0918763019a
Headers show

Commit Message

Marek Szyprowski Feb. 8, 2016, 12:42 p.m. UTC
Retry gadget probe only if the probe result is -EPROBE_DEFER, not on
every probe error.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

---
 drivers/usb/gadget/udc/udc-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
1.9.2
diff mbox

Patch

diff --git a/drivers/usb/gadget/udc/udc-core.c b/drivers/usb/gadget/udc/udc-core.c
index 4bde2e110e44..6599277cc8f5 100644
--- a/drivers/usb/gadget/udc/udc-core.c
+++ b/drivers/usb/gadget/udc/udc-core.c
@@ -413,9 +413,10 @@  int usb_add_gadget_udc_release(struct device *parent, struct usb_gadget *gadget,
 		if (!driver->udc_name || strcmp(driver->udc_name,
 						dev_name(&udc->dev)) == 0) {
 			ret = udc_bind_to_driver(udc, driver);
+			if (ret != -EPROBE_DEFER)
+				list_del(&driver->pending);
 			if (ret)
 				goto err4;
-			list_del(&driver->pending);
 			break;
 		}
 	}