summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc2/gadget.c
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2014-10-20 12:45:35 +0200
committerFelipe Balbi <balbi@ti.com>2014-11-03 17:01:22 +0100
commitac3c81f3e8dcb435a92e03e2fa069d1e60687cfe (patch)
treef94c0285e1de25b7ade55dbf49f748070d744c96 /drivers/usb/dwc2/gadget.c
parentusb: musb: core: remove duplicate check on resource (diff)
downloadlinux-ac3c81f3e8dcb435a92e03e2fa069d1e60687cfe.tar.xz
linux-ac3c81f3e8dcb435a92e03e2fa069d1e60687cfe.zip
usb: dwc2: gadget: move setting last reset time to s3c_hsotg_core_init
This patch removes duplicated code and sets last_rst variable in the function which does the hardware reset. Acked-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to '')
-rw-r--r--drivers/usb/dwc2/gadget.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 701d3e142bbf..f1cde255570a 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -2247,6 +2247,8 @@ static void s3c_hsotg_core_init(struct s3c_hsotg *hsotg)
/* must be at-least 3ms to allow bus to see disconnect */
mdelay(3);
+ hsotg->last_rst = jiffies;
+
/* remove the soft-disconnect and let's go */
__bic32(hsotg->regs + DCTL, DCTL_SFTDISCON);
}
@@ -2341,7 +2343,6 @@ irq_retry:
-ECONNRESET, true);
s3c_hsotg_core_init(hsotg);
- hsotg->last_rst = jiffies;
}
}
}
@@ -2905,7 +2906,6 @@ static int s3c_hsotg_udc_start(struct usb_gadget *gadget,
goto err;
}
- hsotg->last_rst = jiffies;
dev_info(hsotg->dev, "bound driver %s\n", driver->driver.name);
return 0;
@@ -3656,7 +3656,6 @@ static int s3c_hsotg_resume(struct platform_device *pdev)
}
spin_lock_irqsave(&hsotg->lock, flags);
- hsotg->last_rst = jiffies;
s3c_hsotg_phy_enable(hsotg);
s3c_hsotg_core_init(hsotg);
spin_unlock_irqrestore(&hsotg->lock, flags);