Commit 31ccb081 authored by Jamie Lenehan's avatar Jamie Lenehan Committed by Paul Mundt

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: default avatarJamie Lenehan <lenehan@twibble.org>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 417d6b9e
......@@ -21,7 +21,7 @@
#include <linux/seq_file.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <asm/io.h>
#include <linux/io.h>
#ifdef CONFIG_CPU_SH3
#define rtc_reg_size sizeof(u16)
......@@ -73,9 +73,9 @@ struct sh_rtc {
spinlock_t lock;
};
static irqreturn_t sh_rtc_interrupt(int irq, void *id)
static irqreturn_t sh_rtc_interrupt(int irq, void *dev_id)
{
struct platform_device *pdev = id;
struct platform_device *pdev = to_platform_device(dev_id);
struct sh_rtc *rtc = platform_get_drvdata(pdev);
unsigned int tmp, events = 0;
......@@ -97,9 +97,10 @@ static irqreturn_t sh_rtc_interrupt(int irq, void *id)
return IRQ_HANDLED;
}
static irqreturn_t sh_rtc_periodic(int irq, void *id)
static irqreturn_t sh_rtc_periodic(int irq, void *dev_id)
{
struct sh_rtc *rtc = dev_get_drvdata(id);
struct platform_device *pdev = to_platform_device(dev_id);
struct sh_rtc *rtc = platform_get_drvdata(pdev);
spin_lock(&rtc->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment