From patchwork Mon Feb 8 12:42:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 61406 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1413509lbl; Mon, 8 Feb 2016 04:42:49 -0800 (PST) X-Received: by 10.66.161.227 with SMTP id xv3mr42008225pab.117.1454935368472; Mon, 08 Feb 2016 04:42:48 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kw9si8076862pab.63.2016.02.08.04.42.48; Mon, 08 Feb 2016 04:42:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752739AbcBHMme (ORCPT + 30 others); Mon, 8 Feb 2016 07:42:34 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:25834 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752371AbcBHMmb (ORCPT ); Mon, 8 Feb 2016 07:42:31 -0500 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O2800IT4BATM900@mailout4.w1.samsung.com>; Mon, 08 Feb 2016 12:42:29 +0000 (GMT) X-AuditID: cbfec7f4-f79026d00000418a-dc-56b88d34bc59 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id DA.35.16778.43D88B65; Mon, 8 Feb 2016 12:42:28 +0000 (GMT) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O2800AVCBAPOQ40@eusync1.samsung.com>; Mon, 08 Feb 2016 12:42:28 +0000 (GMT) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , Ruslan Bilovol , Bartlomiej Zolnierkiewicz , Vegard Nossum , Maxime Ripard , Greg Kroah-Hartman , Peter Chen , Felipe Balbi Subject: [PATCH] usb: gadget: remove driver from pending list on probe error Date: Mon, 08 Feb 2016 13:42:14 +0100 Message-id: <1454935334-2678-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprBLMWRmVeSWpSXmKPExsVy+t/xy7omvTvCDH5sMLXYOGM9q8Wxtifs Fs2L17NZXN41h81i0bJWZou1R+6yW2zdtJfZ4tjsv0wWPTtPMFqcbVrD6sDl8WTTRUaPf4f7 mTx2zrrL7rFpVSebx/65a9g9Pj69xeLRt2UVo8fnTXIBHFFcNimpOZllqUX6dglcGUvXrmYs uM9WsaT3P1MD4xHWLkZODgkBE4mbHYfYIWwxiQv31rN1MXJxCAksZZToPviOGSQhJNDEJLF4 tzKIzSZgKNH1tguoiINDRMBaou9gEEg9s8BHJomOuROYQOLCAj4Si4/Wg5SzCKhKLLrcBzaG V8BdYlnLfSaIXXIS/1+uYJrAyL2AkWEVo2hqaXJBcVJ6rqFecWJucWleul5yfu4mRkh4fdnB uPiY1SFGAQ5GJR7eio7tYUKsiWXFlbmHGCU4mJVEeH0adoQJ8aYkVlalFuXHF5XmpBYfYpTm YFES5527632IkEB6YklqdmpqQWoRTJaJg1OqgVFfveLfEh7jE0/aanJO/VmQGLiXee7h/p9H Be8Yzrk8qeKF40e524cEv5xi0Pvkumj+4Qg9X66Tz/doTU6Y8uDXweUHci6UHpvp8un9/ymT Az+ohe4VbUq+zJiUcNrlVNOPXN2pPgwL1+ZPv8XR5sc3qYV51Vc+hg8rQ+c+uBT75ZrNA6+q 65K/lFiKMxINtZiLihMBsFbZgisCAAA= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Retry gadget probe only if the probe result is -EPROBE_DEFER, not on every probe error. Signed-off-by: Marek Szyprowski --- drivers/usb/gadget/udc/udc-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 1.9.2 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; } }