From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
To: ab@mycable.de
Cc: mgreer@mvista.com, linux-kernel@vger.kernel.org,
a.zummo@towertech.it, khali@linux-fr.org, akpm@osdl.org
Subject: Re: RTC: add RTC class interface to m41t00 driver
Date: Sat, 05 Aug 2006 01:03:20 +0900 (JST) [thread overview]
Message-ID: <20060805.010320.108306918.anemo@mba.ocn.ne.jp> (raw)
In-Reply-To: <200608041601.03218.ab@mycable.de>
On Fri, 4 Aug 2006 16:01:02 +0200, Alexander Bigga <ab@mycable.de> wrote:
> like you, I started recently with Mark's m41t00.c driver to add support for
> the new rtc-subsystem. Mark reviewed it and I added his changes.
Thank you. Though my patch for m41t00.c intended to keep original
code as is as possible, I like your approach. I'll work with your new
driver.
> There is still the question, if the code for the interrupt context
> (workqueues) should stay or not. You bracketed all this with CONFIG_GEN_RTC.
> I can't say, if this is a good idea. Maybe somebody else has some good
> comments.
I think read_time and set_time routine of rtc_class never called from
the interrupt context. It looks true on current RTC class framework
and some RTC class drivers depend on it already.
> +#include <asm/time.h>
> +#include <asm/rtc.h>
The asm/time.h is not exist on some archs. And while all asm/time.h
are included by asm/rtc.h, this can be removed safely.
> +int m41txx_set_datetime(struct i2c_client *client, struct rtc_time *tm)
static.
> +ulong m41t00_get_rtc_time(void)
> +{
> + struct rtc_time tm;
> +
> + m41txx_get_datetime(save_client, &tm);
> +
> + return mktime(tm.tm_year, tm.tm_mon,
> + tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
> +}
> +EXPORT_SYMBOL_GPL(m41t00_get_rtc_time);
Please drop this old interface from new driver. There are other way
to glue new driver to existing platform, as hctosys.c does.
Then we can remove save_client too.
> +static struct workqueue_struct *m41txx_wq;
As I wrote above, I think this is not needed. If this is really
needed, it should be done in RTC framework instead of lowlevel driver.
> +st_err:
> + dev_err(&client->dev, "%s: Can't clear ST bit\n", __FUNCTION__);
> + goto exit_detach;
> +ht_err:
> + dev_err(&client->dev, "%s: Can't clear HT bit\n", __FUNCTION__);
> + goto exit_detach;
> +sqw_err:
> + dev_err(&client->dev, "%s: Can't set SQW Frequency\n",
> + __FUNCTION__);
> +
> +exit_detach:
> + i2c_detach_client(client);
rtc_device_unregister() must be called somewhere in error path.
---
Atsushi Nemoto
next prev parent reply other threads:[~2006-08-04 16:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-03 15:21 Atsushi Nemoto
2006-08-03 15:42 ` Atsushi Nemoto
2006-08-04 0:21 ` Mark A. Greer
2006-08-04 14:01 ` Alexander Bigga
2006-08-04 16:03 ` Atsushi Nemoto [this message]
2006-08-04 22:57 ` Andrew Morton
2006-08-05 13:28 ` Atsushi Nemoto
2006-08-05 2:33 David Brownell
2006-08-05 16:29 ` Atsushi Nemoto
2006-08-05 17:43 ` Alexander Bigga
2006-08-05 20:23 ` David Brownell
2006-08-07 15:01 ` Alexander Bigga
2006-08-05 19:13 ` David Brownell
2006-08-06 17:09 ` Atsushi Nemoto
2006-08-07 14:55 ` Alexander Bigga
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=20060805.010320.108306918.anemo@mba.ocn.ne.jp \
--to=anemo@mba.ocn.ne.jp \
--cc=a.zummo@towertech.it \
--cc=ab@mycable.de \
--cc=akpm@osdl.org \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mgreer@mvista.com \
/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®