drivers: usb: s3c-hsotg: fix gadget unregistering
authorMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 13 Aug 2013 10:59:10 +0000 (12:59 +0200)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:44:43 +0000 (11:44 +0900)
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
drivers/usb/gadget/s3c-hsotg.c

index 0ec467f..69f9c5e 100644 (file)
@@ -2964,9 +2964,6 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget,
        if (!hsotg)
                return -ENODEV;
 
-       if (!driver || driver != hsotg->driver || !driver->unbind)
-               return -EINVAL;
-
        /* all endpoints should be shutdown */
        for (ep = 0; ep < hsotg->num_of_eps; ep++)
                s3c_hsotg_ep_disable(&hsotg->eps[ep].ep);
@@ -2976,14 +2973,13 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget,
        s3c_hsotg_phy_disable(hsotg);
        regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);
 
-       hsotg->driver = NULL;
+       if (!driver)
+               hsotg->driver = NULL;
+
        hsotg->gadget.speed = USB_SPEED_UNKNOWN;
 
        spin_unlock_irqrestore(&hsotg->lock, flags);
 
-       dev_info(hsotg->dev, "unregistered gadget driver '%s'\n",
-                driver->driver.name);
-
        return 0;
 }