aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/gadget/s3c-hsotg.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c
index d69b36a99dbc..91b1263327b2 100644
--- a/drivers/usb/gadget/s3c-hsotg.c
+++ b/drivers/usb/gadget/s3c-hsotg.c
@@ -2962,9 +2962,6 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget,
2962 if (!hsotg) 2962 if (!hsotg)
2963 return -ENODEV; 2963 return -ENODEV;
2964 2964
2965 if (!driver || driver != hsotg->driver || !driver->unbind)
2966 return -EINVAL;
2967
2968 /* all endpoints should be shutdown */ 2965 /* all endpoints should be shutdown */
2969 for (ep = 0; ep < hsotg->num_of_eps; ep++) 2966 for (ep = 0; ep < hsotg->num_of_eps; ep++)
2970 s3c_hsotg_ep_disable(&hsotg->eps[ep].ep); 2967 s3c_hsotg_ep_disable(&hsotg->eps[ep].ep);
@@ -2972,15 +2969,15 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget,
2972 spin_lock_irqsave(&hsotg->lock, flags); 2969 spin_lock_irqsave(&hsotg->lock, flags);
2973 2970
2974 s3c_hsotg_phy_disable(hsotg); 2971 s3c_hsotg_phy_disable(hsotg);
2975 regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);
2976 2972
2977 hsotg->driver = NULL; 2973 if (!driver)
2974 hsotg->driver = NULL;
2975
2978 hsotg->gadget.speed = USB_SPEED_UNKNOWN; 2976 hsotg->gadget.speed = USB_SPEED_UNKNOWN;
2979 2977
2980 spin_unlock_irqrestore(&hsotg->lock, flags); 2978 spin_unlock_irqrestore(&hsotg->lock, flags);
2981 2979
2982 dev_info(hsotg->dev, "unregistered gadget driver '%s'\n", 2980 regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);
2983 driver->driver.name);
2984 2981
2985 return 0; 2982 return 0;
2986} 2983}