From d21daf1e90514cee8e3fb11c8e28acee3fb87edf Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 21 Jan 2015 00:56:05 +0200 Subject: usb: isp1760: Fix USB disabled check The isp1760 driver registration function returns an error if USB is disabled. This made sense when the driver only supported host controllers, but now that it supports peripheral controllers host support isn't mandatory anymore. Fix this by returning an error only when both the HCD and UDC functions are disabled, either through the kernel configuration or at runtime. Signed-off-by: Laurent Pinchart Signed-off-by: Felipe Balbi --- drivers/usb/isp1760/isp1760-hcd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/usb/isp1760/isp1760-hcd.c') diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c index 568446c9ce8d..996b2c157d12 100644 --- a/drivers/usb/isp1760/isp1760-hcd.c +++ b/drivers/usb/isp1760/isp1760-hcd.c @@ -2226,6 +2226,9 @@ error: void isp1760_hcd_unregister(struct isp1760_hcd *priv) { + if (!priv->hcd) + return; + usb_remove_hcd(priv->hcd); usb_put_hcd(priv->hcd); } -- cgit v1.2.3