aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/renesas_usbhs/common.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-04-28 03:41:14 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-29 20:24:34 -0400
commitbc57381e634782009b1cb2e86b18013699ada576 (patch)
tree2ff4b5937d810ef04aa1960745f06c4e0c99f939 /drivers/usb/renesas_usbhs/common.c
parent5ea68d541df200d10a373c06f945f98225c2486b (diff)
usb: renesas_usbhs: use delayed_work instead of work_struct
This delay is used to overjump debounce. And, this patch also move usbhsc_drvcllbck_notify_hotplug to global, because it will be called from other files. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/renesas_usbhs/common.c')
-rw-r--r--drivers/usb/renesas_usbhs/common.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index db13cef9effe..9a75a45687bb 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -178,7 +178,7 @@ static void usbhsc_notify_hotplug(struct work_struct *work)
178{ 178{
179 struct usbhs_priv *priv = container_of(work, 179 struct usbhs_priv *priv = container_of(work,
180 struct usbhs_priv, 180 struct usbhs_priv,
181 notify_hotplug_work); 181 notify_hotplug_work.work);
182 struct platform_device *pdev = usbhs_priv_to_pdev(priv); 182 struct platform_device *pdev = usbhs_priv_to_pdev(priv);
183 struct usbhs_mod *mod = usbhs_mod_get_current(priv); 183 struct usbhs_mod *mod = usbhs_mod_get_current(priv);
184 int id; 184 int id;
@@ -224,16 +224,17 @@ static void usbhsc_notify_hotplug(struct work_struct *work)
224 } 224 }
225} 225}
226 226
227static int usbhsc_drvcllbck_notify_hotplug(struct platform_device *pdev) 227int usbhsc_drvcllbck_notify_hotplug(struct platform_device *pdev)
228{ 228{
229 struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev); 229 struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev);
230 int delay = usbhs_get_dparam(priv, detection_delay);
230 231
231 /* 232 /*
232 * This functions will be called in interrupt. 233 * This functions will be called in interrupt.
233 * To make sure safety context, 234 * To make sure safety context,
234 * use workqueue for usbhs_notify_hotplug 235 * use workqueue for usbhs_notify_hotplug
235 */ 236 */
236 schedule_work(&priv->notify_hotplug_work); 237 schedule_delayed_work(&priv->notify_hotplug_work, delay);
237 return 0; 238 return 0;
238} 239}
239 240
@@ -300,7 +301,7 @@ static int __devinit usbhs_probe(struct platform_device *pdev)
300 */ 301 */
301 priv->irq = irq; 302 priv->irq = irq;
302 priv->pdev = pdev; 303 priv->pdev = pdev;
303 INIT_WORK(&priv->notify_hotplug_work, usbhsc_notify_hotplug); 304 INIT_DELAYED_WORK(&priv->notify_hotplug_work, usbhsc_notify_hotplug);
304 spin_lock_init(usbhs_priv_to_lock(priv)); 305 spin_lock_init(usbhs_priv_to_lock(priv));
305 306
306 /* call pipe and module init */ 307 /* call pipe and module init */