From mboxrd@z Thu Jan 1 00:00:00 1970 From: ahaslam-rdvid1DuHRBWk0Htik3J/w@public.gmane.org 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> References: <1475858577-10366-1-git-send-email-ahaslam@baylibre.com> Return-path: In-Reply-To: <1475858577-10366-1-git-send-email-ahaslam-rdvid1DuHRBWk0Htik3J/w@public.gmane.org> Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, nsekhar-l0cyMroinI0@public.gmane.org, stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org, khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org, sshtylyov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org, david-nq/r/kbU++upp/zk7JDF2g@public.gmane.org Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Axel Haslam List-Id: devicetree@vger.kernel.org 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 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html