[patch] Input: omap-keypad: set tasklet data earlier

Subsystems: input (keyboard, mouse, joystick, touchscreen) drivers, the rest

STALE3896d

2 messages, 2 authors, 2016-01-07 · open the first message on its own page

[patch] Input: omap-keypad: set tasklet data earlier

From: Dan Carpenter <hidden>
Date: 2016-01-07 09:36:48

It feels like we should set the tasklet data before enabling it.

Signed-off-by: Dan Carpenter <redacted>
diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c
index 7502e46..75ad666 100644
--- a/drivers/input/keyboard/omap-keypad.c
+++ b/drivers/input/keyboard/omap-keypad.c
@@ -292,8 +292,8 @@ static int omap_kp_probe(struct platform_device *pdev)
 	setup_timer(&omap_kp->timer, omap_kp_timer, (unsigned long)omap_kp);
 
 	/* get the irq and init timer*/
-	tasklet_enable(&kp_tasklet);
 	kp_tasklet.data = (unsigned long) omap_kp;
+	tasklet_enable(&kp_tasklet);
 
 	ret = device_create_file(&pdev->dev, &dev_attr_enable);
 	if (ret < 0)

Re: [patch] Input: omap-keypad: set tasklet data earlier

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2016-01-07 17:55:32

On Thu, Jan 07, 2016 at 12:36:48PM +0300, Dan Carpenter wrote:
It feels like we should set the tasklet data before enabling it.

Signed-off-by: Dan Carpenter <redacted>
Applied, thank you.
quoted hunk
diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c
index 7502e46..75ad666 100644
--- a/drivers/input/keyboard/omap-keypad.c
+++ b/drivers/input/keyboard/omap-keypad.c
@@ -292,8 +292,8 @@ static int omap_kp_probe(struct platform_device *pdev)
 	setup_timer(&omap_kp->timer, omap_kp_timer, (unsigned long)omap_kp);
 
 	/* get the irq and init timer*/
-	tasklet_enable(&kp_tasklet);
 	kp_tasklet.data = (unsigned long) omap_kp;
+	tasklet_enable(&kp_tasklet);
 
 	ret = device_create_file(&pdev->dev, &dev_attr_enable);
 	if (ret < 0)
-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help