public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Andrey Volkov <avolkov@varma-el.com>
Cc: lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org,
	"Mark A. Greer" <mgreer@mvista.com>
Subject: Re: [PATCH 1/1] Added support of ST m41t85 rtc chip
Date: Tue, 15 Nov 2005 21:52:26 +0100	[thread overview]
Message-ID: <20051115215226.4e6494e0.khali@linux-fr.org> (raw)
In-Reply-To: <4378960F.8030800@varma-el.com>

Hi Andrey,

> Possible too late to include in 2.6.15,
> but better later then never :).

You must be kidding. It might be too late for 2.6._16_. Reviewing takes
time, reworking afterwards takes time, then you get some testing in -mm
and it takes time again.

> Comments?

Sure, although I don't really have the time right now for a complete
review. And I'd rather not review the code if it finally isn't used.

First, a question. Can't you merge the M41T85 support into the m41t00
driver?

Mark, care to comment on that possibility, and/or on the code itself?

> +config SENSORS_M41T85
> +	tristate "ST M41T85 RTC chip"
> +	depends on I2C

I would pretty much likt it named RTC_M41T85 or RTC_M41T85_I2C instead.
It's not a sensor in any way. And it must depend on EXPERIMENTAL to
start with.

> +config SENSORS_M41T85_SQW_FRQ_ENABLE
> +	depends on SENSORS_M41T85
> +	bool "Square Wave Output"

What a mess. Please just have a sysfs file for that, it's more flexible
and less intrusive.

> +/*
> + * drivers/i2c/chips/m41t85.c
> + *

Redundant, you know where the file is if you found it.

> + * HISTORY:
> + *	 2005-10-12	Created
> + */

History doesn't belong to the source code.

> +/*
> + * This i2c client/driver wedges between the drivers/char/genrtc.c RTC
> + * interface and the SMBus interface of the i2c subsystem.
> + * It would be more efficient to use i2c msgs/i2c_transfer directly but, as
> + * recommened in .../Documentation/i2c/writing-clients section
> + * "Sending and receiving", using SMBus level communication is preferred.
> + */

The i2c_transfer interface wouldn't exist if nobody was ever supposed
to use it. Using the SMBus compatible interface makes it possible to
use your chip in conjunction with more I2C or SMBus masters. But maybe
you just need a specific driver for a specific case, and you just don't
care about the other cases. In that case, go with i2c_transfer for
smaller and faster code.

Also, use <file:Documentation/...> for referencing document files.

> +#define	M41T85_DRV_NAME		"m41t85"

Please define m41t85_driver.name directly, and use references to it
where needed. This avoids duplicating string constants.

> +static void
> +m41t85_set_tlet(ulong arg)
> +{
> +	struct rtc_time	tm;
> +	ulong	nowtime = *(ulong *)arg;

What's the idea behind this cast?

> +	strncpy(client->name, M41T85_DRV_NAME, I2C_NAME_SIZE);

Please use strlcpy instead.

> +static void __exit
> +m41t85_exit(void)
> +{
> +	i2c_del_driver(&m41t85_driver);
> +	return;
> +}

Drop this "return" statement, it is useless.

Thanks,
-- 
Jean Delvare

  parent reply	other threads:[~2005-11-15 20:51 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-14 13:50 [PATCH 1/1] Added support of ST m41t85 rtc chip Andrey Volkov
2005-11-15  0:41 ` Andrew Morton
2005-11-15 21:24   ` Andrey Volkov
2005-11-15 20:52 ` Jean Delvare [this message]
2005-11-15 21:48   ` Andrey Volkov
2005-11-16  3:15     ` Mark A. Greer
2005-11-16 14:50       ` Andrey Volkov
2005-11-16 18:55       ` Andy Isaacson
2005-11-16 22:24         ` Mark A. Greer
2005-11-18 20:35           ` Mark A. Greer
2005-11-21 12:35             ` Andrey Volkov
2005-12-06 21:18               ` Mark A. Greer
2005-11-16  2:57   ` Mark A. Greer
2005-11-16 14:45     ` Andrey Volkov
2005-11-16 15:19       ` Jean Delvare
2005-11-16 16:43         ` Andrey Volkov
2005-11-16 21:36           ` Mark A. Greer
2005-11-17  9:20           ` Jean Delvare
2005-11-16 21:24         ` Mark A. Greer
2005-12-19 21:03     ` [RFC] i2c: Combined ST m41txx i2c rtc chip driver (was: [PATCH 1/1] Added support of ST m41t85 rtc chip) Mark A. Greer
2005-12-19 21:06       ` Mark A. Greer
2005-12-20 10:05       ` [RFC] i2c: Combined ST m41txx i2c rtc chip driver Andrey Volkov
2005-12-21 21:25         ` Mark A. Greer
     [not found]         ` <20060111000912.GA11471@mag.az.mvista.com>
     [not found]           ` <43C4D275.2070505@varma-el.com>
     [not found]             ` <20060111161954.GB6405@mag.az.mvista.com>
2006-01-11 19:03               ` Andrey Volkov
2006-01-18 22:06                 ` Mark A. Greer
2006-01-19  7:25                   ` Jean Delvare
2006-01-26  2:01                     ` Mark A. Greer
2006-01-26 20:50                       ` 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=20051115215226.4e6494e0.khali@linux-fr.org \
    --to=khali@linux-fr.org \
    --cc=avolkov@varma-el.com \
    --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