aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/isp1760/isp1760-udc.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2015-01-21 00:56:05 +0200
committerFelipe Balbi <balbi@ti.com>2015-01-27 09:39:51 -0600
commitd21daf1e90514cee8e3fb11c8e28acee3fb87edf (patch)
treea44d5731b4bf452d65a5710d9f87e97945ce2573 /drivers/usb/isp1760/isp1760-udc.c
parentusb: isp1760: Remove duplicate usb_disabled() check (diff)
downloadlinux-dev-d21daf1e90514cee8e3fb11c8e28acee3fb87edf.tar.xz
linux-dev-d21daf1e90514cee8e3fb11c8e28acee3fb87edf.zip
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 <laurent.pinchart@ideasonboard.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/isp1760/isp1760-udc.c')
-rw-r--r--drivers/usb/isp1760/isp1760-udc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/isp1760/isp1760-udc.c b/drivers/usb/isp1760/isp1760-udc.c
index 6bfda3082807..9612d7990565 100644
--- a/drivers/usb/isp1760/isp1760-udc.c
+++ b/drivers/usb/isp1760/isp1760-udc.c
@@ -1488,6 +1488,9 @@ void isp1760_udc_unregister(struct isp1760_device *isp)
{
struct isp1760_udc *udc = &isp->udc;
+ if (!udc->isp)
+ return;
+
usb_del_gadget_udc(&udc->gadget);
free_irq(udc->irq, udc);