Commit ac3c81f3 authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Felipe Balbi

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: default avatarPaul Zimmerman <paulz@synopsys.com>
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 1f79b26c
...@@ -2247,6 +2247,8 @@ static void s3c_hsotg_core_init(struct s3c_hsotg *hsotg) ...@@ -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 */ /* must be at-least 3ms to allow bus to see disconnect */
mdelay(3); mdelay(3);
hsotg->last_rst = jiffies;
/* remove the soft-disconnect and let's go */ /* remove the soft-disconnect and let's go */
__bic32(hsotg->regs + DCTL, DCTL_SFTDISCON); __bic32(hsotg->regs + DCTL, DCTL_SFTDISCON);
} }
...@@ -2341,7 +2343,6 @@ static irqreturn_t s3c_hsotg_irq(int irq, void *pw) ...@@ -2341,7 +2343,6 @@ static irqreturn_t s3c_hsotg_irq(int irq, void *pw)
-ECONNRESET, true); -ECONNRESET, true);
s3c_hsotg_core_init(hsotg); s3c_hsotg_core_init(hsotg);
hsotg->last_rst = jiffies;
} }
} }
} }
...@@ -2905,7 +2906,6 @@ static int s3c_hsotg_udc_start(struct usb_gadget *gadget, ...@@ -2905,7 +2906,6 @@ static int s3c_hsotg_udc_start(struct usb_gadget *gadget,
goto err; goto err;
} }
hsotg->last_rst = jiffies;
dev_info(hsotg->dev, "bound driver %s\n", driver->driver.name); dev_info(hsotg->dev, "bound driver %s\n", driver->driver.name);
return 0; return 0;
...@@ -3656,7 +3656,6 @@ static int s3c_hsotg_resume(struct platform_device *pdev) ...@@ -3656,7 +3656,6 @@ static int s3c_hsotg_resume(struct platform_device *pdev)
} }
spin_lock_irqsave(&hsotg->lock, flags); spin_lock_irqsave(&hsotg->lock, flags);
hsotg->last_rst = jiffies;
s3c_hsotg_phy_enable(hsotg); s3c_hsotg_phy_enable(hsotg);
s3c_hsotg_core_init(hsotg); s3c_hsotg_core_init(hsotg);
spin_unlock_irqrestore(&hsotg->lock, flags); spin_unlock_irqrestore(&hsotg->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment