From: Andrew Morton <akpm@osdl.org>
To: Ben Dooks <ben@fluff.org.uk>
Cc: linux-kernel@vger.kernel.org, Alessandro Zummo <a.zummo@towertech.it>
Subject: Re: [RFC] RTC: class driver for Samsung S3C series SoC
Date: Thu, 29 Jun 2006 17:50:18 -0700 [thread overview]
Message-ID: <20060629175018.10ac28c8.akpm@osdl.org> (raw)
In-Reply-To: <20060629225325.GA11799@home.fluff.org>
Ben Dooks <ben@fluff.org.uk> wrote:
>
> This is a renamed and tested version of the
> previous S3C24XX RTC class driver.
>
> The driver has been renamed from the original
> s3c2410-rtc, which is now too narrow for the
> range of devices supported.
>
> The rtc-s3c has been chosen as there is the
> distinct possibility of this driver being
> carried forward into newer Samsung SoC
> silicon.
>
> +#undef S3C24XX_VA_RTC
> +#define S3C24XX_VA_RTC s3c_rtc_base
This appears to be unused?
> +static int s3c_rtc_open(struct device *dev)
> +{
> + struct platform_device *pdev = to_platform_device(dev);
> + struct rtc_device *rtc_dev = platform_get_drvdata(pdev);
> + int ret;
> +
> + ret = request_irq(s3c_rtc_alarmno, s3c_rtc_alarmirq,
> + SA_INTERRUPT, "s3c2410-rtc alarm", rtc_dev);
> +
> + if (ret)
> + dev_err(dev, "IRQ%d error %d\n", s3c_rtc_alarmno, ret);
I suspect you wanted a `return ret;' here.
> + ret = request_irq(s3c_rtc_tickno, s3c_rtc_tickirq,
> + SA_INTERRUPT, "s3c2410-rtc tick", rtc_dev);
> +
> + if (ret) {
> + dev_err(dev, "IRQ%d error %d\n", s3c_rtc_tickno, ret);
> + goto tick_err;
> + }
> +
> + return ret;
> +
> + tick_err:
> + free_irq(s3c_rtc_alarmno, rtc_dev);
> + return ret;
> +}
Are you sure you want spaces in the interrupt identifiers? It'll make
parsing of /proc/interrupts harder, although I don't know that we're at all
consistent about that.
From: Andrew Morton <akpm@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
drivers/rtc/rtc-s3c.c | 36 ++++++++++++++----------------------
1 files changed, 14 insertions(+), 22 deletions(-)
diff -puN drivers/rtc/rtc-s3c.c~rtc-class-driver-for-samsung-s3c-series-soc-tidy drivers/rtc/rtc-s3c.c
--- a/drivers/rtc/rtc-s3c.c~rtc-class-driver-for-samsung-s3c-series-soc-tidy
+++ a/drivers/rtc/rtc-s3c.c
@@ -34,9 +34,6 @@
/* I have yet to find an S3C implementation with more than one
* of these rtc blocks in */
-#undef S3C24XX_VA_RTC
-#define S3C24XX_VA_RTC s3c_rtc_base
-
static struct resource *s3c_rtc_mem;
static void __iomem *s3c_rtc_base;
@@ -45,6 +42,7 @@ static int s3c_rtc_tickno = NO_IRQ;
static int s3c_rtc_freq = 1;
static DEFINE_SPINLOCK(s3c_rtc_pie_lock);
+static unsigned int tick_count;
/* IRQ Handlers */
@@ -56,8 +54,6 @@ static irqreturn_t s3c_rtc_alarmirq(int
return IRQ_HANDLED;
}
-static unsigned int tick_count;
-
static irqreturn_t s3c_rtc_tickirq(int irq, void *id, struct pt_regs *r)
{
struct rtc_device *rdev = id;
@@ -153,7 +149,6 @@ static int s3c_rtc_gettime(struct device
return 0;
}
-
static int s3c_rtc_settime(struct device *dev, struct rtc_time *tm)
{
/* the rtc gets round the y2k problem by just not supporting it */
@@ -193,29 +188,25 @@ static int s3c_rtc_getalarm(struct devic
/* decode the alarm enable field */
- if (alm_en & S3C2410_RTCALM_SECEN) {
+ if (alm_en & S3C2410_RTCALM_SECEN)
BCD_TO_BIN(alm_tm->tm_sec);
- } else {
+ else
alm_tm->tm_sec = 0xff;
- }
- if (alm_en & S3C2410_RTCALM_MINEN) {
+ if (alm_en & S3C2410_RTCALM_MINEN)
BCD_TO_BIN(alm_tm->tm_min);
- } else {
+ else
alm_tm->tm_min = 0xff;
- }
- if (alm_en & S3C2410_RTCALM_HOUREN) {
+ if (alm_en & S3C2410_RTCALM_HOUREN)
BCD_TO_BIN(alm_tm->tm_hour);
- } else {
+ else
alm_tm->tm_hour = 0xff;
- }
- if (alm_en & S3C2410_RTCALM_DAYEN) {
+ if (alm_en & S3C2410_RTCALM_DAYEN)
BCD_TO_BIN(alm_tm->tm_mday);
- } else {
+ else
alm_tm->tm_mday = 0xff;
- }
if (alm_en & S3C2410_RTCALM_MONEN) {
BCD_TO_BIN(alm_tm->tm_mon);
@@ -224,11 +215,10 @@ static int s3c_rtc_getalarm(struct devic
alm_tm->tm_mon = 0xff;
}
- if (alm_en & S3C2410_RTCALM_YEAREN) {
+ if (alm_en & S3C2410_RTCALM_YEAREN)
BCD_TO_BIN(alm_tm->tm_year);
- } else {
+ else
alm_tm->tm_year = 0xffff;
- }
return 0;
}
@@ -352,8 +342,10 @@ static int s3c_rtc_open(struct device *d
ret = request_irq(s3c_rtc_alarmno, s3c_rtc_alarmirq,
SA_INTERRUPT, "s3c2410-rtc alarm", rtc_dev);
- if (ret)
+ if (ret) {
dev_err(dev, "IRQ%d error %d\n", s3c_rtc_alarmno, ret);
+ return ret;
+ }
ret = request_irq(s3c_rtc_tickno, s3c_rtc_tickirq,
SA_INTERRUPT, "s3c2410-rtc tick", rtc_dev);
_
prev parent reply other threads:[~2006-06-30 0:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-29 22:53 Ben Dooks
2006-06-30 0:50 ` Andrew Morton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060629175018.10ac28c8.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=a.zummo@towertech.it \
--cc=ben@fluff.org.uk \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®