Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965328AbcJGQp1 (ORCPT ); Fri, 7 Oct 2016 12:45:27 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:35837 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964922AbcJGQnM (ORCPT ); Fri, 7 Oct 2016 12:43:12 -0400 From: ahaslam@baylibre.com To: gregkh@linuxfoundation.org, robh+dt@kernel.org, nsekhar@ti.com, stern@rowland.harvard.edu, khilman@baylibre.com, sshtylyov@ru.mvista.com, david@lechnology.com Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Axel Haslam Subject: [PATCH/RFT 05/12] USB: ohci-da8xx: Fix probe for devices with no vbus/oci gpio Date: Fri, 7 Oct 2016 18:42:50 +0200 Message-Id: <1475858577-10366-6-git-send-email-ahaslam@baylibre.com> X-Mailer: git-send-email 2.7.1 In-Reply-To: <1475858577-10366-1-git-send-email-ahaslam@baylibre.com> References: <1475858577-10366-1-git-send-email-ahaslam@baylibre.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1175 Lines: 42 From: Axel Haslam Some boards dont have gpios assigened for vbus or oci. Allow these boards to enumerate usb without declaring the set_power and/or the ocic_notify callbacks in platform data. Signed-off-by: Axel Haslam --- drivers/usb/host/ohci-da8xx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index 3c85d6c..9d9f8e3 100644 --- a/drivers/usb/host/ohci-da8xx.c +++ b/drivers/usb/host/ohci-da8xx.c @@ -215,7 +215,7 @@ static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, temp ? "Set" : "Clear", wIndex, "POWER"); if (!pdata->set_power) - return -EPIPE; + return 0; return pdata->set_power(wIndex, temp) ? -EPIPE : 0; case USB_PORT_FEAT_C_OVER_CURRENT: @@ -343,10 +343,12 @@ static int usb_hcd_da8xx_probe(const struct hc_driver *driver, if (pdata->ocic_notify) { error = pdata->ocic_notify(ohci_da8xx_ocic_handler); - if (!error) - return 0; + if (error) + goto err_notify; } + return 0; +err_notify: usb_remove_hcd(hcd); err: usb_put_hcd(hcd); -- 2.7.1