Patchwork rtc: imx dryice: Add missing spinlock init

login
register
mail settings
Submitter Jean Delvare
Date Sept. 6, 2012, noon
Message ID <20120906140028.6803051b@endymion.delvare>
Download mbox | patch
Permalink /patch/182157/
State New
Headers show

Comments

Jean Delvare - Sept. 6, 2012, noon
It doesn't seem this spinlock was properly initialized. Also add the
missing header include for spinlocks.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>
---
I can't even build-test this.

 drivers/rtc/rtc-imxdi.c |    3 +++
 1 file changed, 3 insertions(+)
Sascha Hauer - Sept. 6, 2012, 12:21 p.m.
On Thu, Sep 06, 2012 at 02:00:28PM +0200, Jean Delvare wrote:
> It doesn't seem this spinlock was properly initialized. Also add the
> missing header include for spinlocks.
> 
> Signed-off-by: Jean Delvare <khali@linux-fr.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Alessandro Zummo <a.zummo@towertech.it>

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>

> ---
> I can't even build-test this.

(I just did)

Sascha

> 
>  drivers/rtc/rtc-imxdi.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> --- linux-3.6-rc4.orig/drivers/rtc/rtc-imxdi.c	2012-09-06 13:50:04.000000000 +0200
> +++ linux-3.6-rc4/drivers/rtc/rtc-imxdi.c	2012-09-06 13:52:20.064386284 +0200
> @@ -36,6 +36,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/rtc.h>
>  #include <linux/sched.h>
> +#include <linux/spinlock.h>
>  #include <linux/workqueue.h>
>  
>  /* DryIce Register Definitions */
> @@ -396,6 +397,8 @@ static int dryice_rtc_probe(struct platf
>  	if (imxdi->irq < 0)
>  		return imxdi->irq;
>  
> +	spin_lock_init(&imxdi->irq_lock);
> +
>  	init_waitqueue_head(&imxdi->write_wait);
>  
>  	INIT_WORK(&imxdi->work, dryice_work);
> 
> 
> -- 
> Jean Delvare
>

Patch

--- linux-3.6-rc4.orig/drivers/rtc/rtc-imxdi.c	2012-09-06 13:50:04.000000000 +0200
+++ linux-3.6-rc4/drivers/rtc/rtc-imxdi.c	2012-09-06 13:52:20.064386284 +0200
@@ -36,6 +36,7 @@ 
 #include <linux/platform_device.h>
 #include <linux/rtc.h>
 #include <linux/sched.h>
+#include <linux/spinlock.h>
 #include <linux/workqueue.h>
 
 /* DryIce Register Definitions */
@@ -396,6 +397,8 @@  static int dryice_rtc_probe(struct platf
 	if (imxdi->irq < 0)
 		return imxdi->irq;
 
+	spin_lock_init(&imxdi->irq_lock);
+
 	init_waitqueue_head(&imxdi->write_wait);
 
 	INIT_WORK(&imxdi->work, dryice_work);