aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJamie Lenehan <lenehan@twibble.org>2006-12-07 03:23:50 -0500
committerPaul Mundt <lethal@linux-sh.org>2006-12-11 18:42:07 -0500
commit31ccb081ec6c7eedfd7e88a48365c67ce44ecb92 (patch)
tree4aec69a007bb8097ca20364b0143d1af4660bd25 /drivers
parent417d6b9edb5958c2cc76e8ef701ebe09a3152deb (diff)
rtc: rtc-sh: fix for period rtc interrupts.
When testing the per second interrupt support (RTC_UIE_ON/RTC_UIE_OFF) of the new RTC system it would die in sh_rtc_interrupt due to a null ptr dereference. The following gets it working correctly. Signed-off-by: Jamie Lenehan <lenehan@twibble.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/rtc/rtc-sh.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c
index 143302a8e79c..1ffc01ea730e 100644
--- a/drivers/rtc/rtc-sh.c
+++ b/drivers/rtc/rtc-sh.c
@@ -21,7 +21,7 @@
21#include <linux/seq_file.h> 21#include <linux/seq_file.h>
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <asm/io.h> 24#include <linux/io.h>
25 25
26#ifdef CONFIG_CPU_SH3 26#ifdef CONFIG_CPU_SH3
27#define rtc_reg_size sizeof(u16) 27#define rtc_reg_size sizeof(u16)
@@ -33,22 +33,22 @@
33 33
34#define RTC_REG(r) ((r) * rtc_reg_size) 34#define RTC_REG(r) ((r) * rtc_reg_size)
35 35
36#define R64CNT RTC_REG(0) 36#define R64CNT RTC_REG(0)
37#define RSECCNT RTC_REG(1) 37#define RSECCNT RTC_REG(1)
38#define RMINCNT RTC_REG(2) 38#define RMINCNT RTC_REG(2)
39#define RHRCNT RTC_REG(3) 39#define RHRCNT RTC_REG(3)
40#define RWKCNT RTC_REG(4) 40#define RWKCNT RTC_REG(4)
41#define RDAYCNT RTC_REG(5) 41#define RDAYCNT RTC_REG(5)
42#define RMONCNT RTC_REG(6) 42#define RMONCNT RTC_REG(6)
43#define RYRCNT RTC_REG(7) 43#define RYRCNT RTC_REG(7)
44#define RSECAR RTC_REG(8) 44#define RSECAR RTC_REG(8)
45#define RMINAR RTC_REG(9) 45#define RMINAR RTC_REG(9)
46#define RHRAR RTC_REG(10) 46#define RHRAR RTC_REG(10)
47#define RWKAR RTC_REG(11) 47#define RWKAR RTC_REG(11)
48#define RDAYAR RTC_REG(12) 48#define RDAYAR RTC_REG(12)
49#define RMONAR RTC_REG(13) 49#define RMONAR RTC_REG(13)
50#define RCR1 RTC_REG(14) 50#define RCR1 RTC_REG(14)
51#define RCR2 RTC_REG(15) 51#define RCR2 RTC_REG(15)
52 52
53/* RCR1 Bits */ 53/* RCR1 Bits */
54#define RCR1_CF 0x80 /* Carry Flag */ 54#define RCR1_CF 0x80 /* Carry Flag */
@@ -73,9 +73,9 @@ struct sh_rtc {
73 spinlock_t lock; 73 spinlock_t lock;
74}; 74};
75 75
76static irqreturn_t sh_rtc_interrupt(int irq, void *id) 76static irqreturn_t sh_rtc_interrupt(int irq, void *dev_id)
77{ 77{
78 struct platform_device *pdev = id; 78 struct platform_device *pdev = to_platform_device(dev_id);
79 struct sh_rtc *rtc = platform_get_drvdata(pdev); 79 struct sh_rtc *rtc = platform_get_drvdata(pdev);
80 unsigned int tmp, events = 0; 80 unsigned int tmp, events = 0;
81 81
@@ -97,9 +97,10 @@ static irqreturn_t sh_rtc_interrupt(int irq, void *id)
97 return IRQ_HANDLED; 97 return IRQ_HANDLED;
98} 98}
99 99
100static irqreturn_t sh_rtc_periodic(int irq, void *id) 100static irqreturn_t sh_rtc_periodic(int irq, void *dev_id)
101{ 101{
102 struct sh_rtc *rtc = dev_get_drvdata(id); 102 struct platform_device *pdev = to_platform_device(dev_id);
103 struct sh_rtc *rtc = platform_get_drvdata(pdev);
103 104
104 spin_lock(&rtc->lock); 105 spin_lock(&rtc->lock);
105 106