diff mbox

Input: omap-keypad: set tasklet data earlier

Message ID 20160107093648.GC27186@mwanda (mailing list archive)
State Accepted
Headers show

Commit Message

Dan Carpenter Jan. 7, 2016, 9:36 a.m. UTC
It feels like we should set the tasklet data before enabling it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Dmitry Torokhov Jan. 7, 2016, 5:55 p.m. UTC | #1
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 <dan.carpenter@oracle.com>

Applied, thank you.

> 
> 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)
diff mbox

Patch

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)