drivers: s3c-hsotg: fix regulator enable sequence in resume callback
authorMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 25 Oct 2013 09:24:21 +0000 (11:24 +0200)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:45:00 +0000 (11:45 +0900)
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
drivers/usb/gadget/s3c-hsotg.c

index 55c6f92..333a647 100644 (file)
@@ -3709,8 +3709,11 @@ static int s3c_hsotg_resume(struct platform_device *pdev)
        unsigned long flags;
        int ret = 0;
 
-       if (hsotg->driver)
+       if (hsotg->driver) {
                dev_info(hsotg->dev, "resuming usb gadget %s\n", hsotg->driver->driver.name);
+               ret = regulator_bulk_enable(ARRAY_SIZE(hsotg->supplies),
+                                     hsotg->supplies);
+       }
 
        spin_lock_irqsave(&hsotg->lock, flags);
        hsotg->last_rst = jiffies;
@@ -3718,10 +3721,6 @@ static int s3c_hsotg_resume(struct platform_device *pdev)
        s3c_hsotg_core_init(hsotg);
        spin_unlock_irqrestore(&hsotg->lock, flags);
 
-       if (hsotg->driver)
-               ret = regulator_bulk_enable(ARRAY_SIZE(hsotg->supplies),
-                                     hsotg->supplies);
-
        return ret;
 }