Skip to contentSkip to conversation

sh: push-switch: use setup_timer() helper.

PATCH New Allen Pais 1 participant 1 message Sep 22, 2017 SuperH

lore
Share & tools
lore

Allen Pais

author
#0 lore raw

PATCH 1/2 sh: push-switch: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the function and data fields.

---
 arch/sh/drivers/push-switch.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/sh/drivers/push-switch.c +1 -4
index 5bfb341..8e02851 100644
@@ -78,11 +78,8 @@ static int switch_drv_probe(struct platform_device *pdev)
 	}
 
 	INIT_WORK(&psw->work, switch_work_handler);
-	init_timer(&psw->debounce);
-
-	psw->debounce.function = switch_timer;
-	psw->debounce.data = (unsigned long)psw;
 
+	setup_timer(&psw->debounce, switch_timer, (unsigned long)psw);
 	/* Workqueue API brain-damage */
 	psw->pdev = pdev;
 
Signature · 1 line
2.7.4