From: Jean Delvare <khali@linux-fr.org>
To: "Mark A. Greer" <mgreer@mvista.com>
Cc: Andrew Morton <akpm@osdl.org>,
lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.16-mm1 3/3] rtc: add support for m41t81 & m41t85 chips to m41t00 driver
Date: Tue, 28 Mar 2006 20:30:08 +0200 [thread overview]
Message-ID: <20060328203008.5910ead6.khali@linux-fr.org> (raw)
In-Reply-To: <20060328181111.GB14170@mag.az.mvista.com>
Hi Mark,
Answering your questions before I forget about them and let a week pass
again...
Anything I don't comment on, means that you were right and I agree with
you.
> > May I ask why you define separate types for the M41T81 and the M41T85,
> > when you handle both exactly the same way?
>
> The only reason is so that its obvious that both the t81 and t85 are
> supported. If I make it M41T81 only then I can easily see someone
> grep'ing around looking for M41T85, not finding it, and writing their
> own driver. I don't see any harm in having both, do you?
It wastes some memory, and you may later fix something for the M41T81
and forget to fix it for the M41T85.
If your only concern is to help grepers, you can add a clear list of
supported chips either as a comment at the top of the source file, or
as Documentation/i2c/chips/m41t00. That's what we do for hardware
monitoring chips.
No big deal anyway, so the decision is up to you.
> > What you do here are basically SMBus Read Byte and SMBus Write Byte
> > transactions. The code would be much more simple if you were using the
> > i2c_smbus_read_byte_data and i2c_smbus_write_byte_data functions, which
> > take care of all the technical details.
>
> That's true but I assumed that since I was using i2c_transfer
> earlier, I should use it here. Is that a bad assumption?
> I do see that ds1337.c uses both types.
Bad assumption, indeed. Nothing prevents you from using the smbus
functions and the i2c functions in the same driver, as long as your
call to i2c_check_functionality covers every function you use. So,
just use whatever makes your driver easier to write.
Thanks,
--
Jean Delvare
next prev parent reply other threads:[~2006-03-28 18:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <440B4B6E.8080307@sh.cvut.cz>
[not found] ` <zt2d4LqL.1141645514.2993990.khali@localhost>
[not found] ` <20060307170107.GA5250@mag.az.mvista.com>
[not found] ` <20060318001254.GA14079@mag.az.mvista.com>
[not found] ` <20060323210856.f1bfd02b.khali@linux-fr.org>
[not found] ` <20060323203843.GA18912@mag.az.mvista.com>
2006-03-24 1:18 ` [PATCH 2.6.16-mm1 1/3] rtc: m41t00 driver should use workqueue instead of tasklet Mark A. Greer
2006-03-27 17:03 ` Jean Delvare
2006-03-28 0:22 ` Mark A. Greer
2006-03-24 1:21 ` [PATCH 2.6.16-mm1 2/3] rtc: m41t00 driver cleanup Mark A. Greer
2006-03-27 17:11 ` Jean Delvare
2006-03-27 22:35 ` Mark A. Greer
2006-03-28 0:23 ` Mark A. Greer
2006-03-24 1:24 ` [PATCH 2.6.16-mm1 3/3] rtc: add support for m41t81 & m41t85 chips to m41t00 driver Mark A. Greer
2006-03-26 22:58 ` Andrew Morton
2006-03-27 22:34 ` Mark A. Greer
2006-03-28 0:26 ` Mark A. Greer
2006-03-28 0:51 ` Andrew Morton
2006-03-28 12:21 ` Jean Delvare
2006-03-28 17:15 ` Mark A. Greer
2006-03-28 15:54 ` Jean Delvare
2006-03-28 18:11 ` Mark A. Greer
2006-03-28 18:30 ` Jean Delvare [this message]
2006-03-28 23:12 ` Mark A. Greer
2006-04-01 17:20 ` Jean Delvare
2006-04-03 18:01 ` Mark A. Greer
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=20060328203008.5910ead6.khali@linux-fr.org \
--to=khali@linux-fr.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lm-sensors@lm-sensors.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