From: Christoph Hellwig <hch@infradead.org>
To: GertJan Spoelman <kl@gjs.cc>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH] i2c-isa and w83871d sensors support
Date: Sat, 11 Jan 2003 08:22:23 +0000 [thread overview]
Message-ID: <20030111082222.A20116@infradead.org> (raw)
In-Reply-To: <200301051844.55795.kl@gjs.cc>; from kl@gjs.cc on Sun, Jan 05, 2003 at 06:44:55PM +0100
On Sun, Jan 05, 2003 at 06:44:55PM +0100, GertJan Spoelman wrote:
> This patch adds the i2c-isa pseudo ISA adapter and the w8387* series
> sensors support to 2.5.54 (tested on bk1 and bk3).
>
> I've just took the code from the lm_sensor package and changed it
> to be more or less consistent with the lm75 and amd* patches Christoph
> has done.
> Christoph, maybe you could check this because I don't really understand
> all of the code and maybe it needs some more changes.
Looks fine in principle. A few nitpicks:
> +static struct i2c_algorithm isa_algorithm = {
> + .name = "ISA bus algorithm",
> + .id = I2C_ALGO_ISA,
> + .smbus_xfer = NULL,
> + .functionality = &isa_func,
> +};
There's no need to initialize a struct member to zero/NULL.
> +static int __init isa_init(void)
> +{
> + int res;
> + if (isa_initialized) {
> + pr_debug(DRV_NAME
> + ": i2c-isa.o: Oops, isa_init called a second time!\n");
> + return -EBUSY;
> + }
> + isa_initialized = 0;
> + if ((res = i2c_add_adapter(&isa_adapter))) {
> + printk(KERN_ERR DRV_NAME
> + ": Adapter registration failed, module not inserted\n.");
> + isa_cleanup();
> + return res;
> + }
> + isa_initialized++;
> + printk("i2c-isa.o: ISA bus access for i2c modules initialized.\n");
> + return 0;
Please remove the <foo>_initialized handling. It just obsfucates the code.
> +static void __exit isa_exit(void)
> +{
> + isa_cleanup();
> +}
Just move the code from isa_cleanup into isa_exit directly.
next prev parent reply other threads:[~2003-01-11 8:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200212280303.gBS33o628113@hera.kernel.org>
2002-12-28 11:46 ` [PATCH] amd756 and amd8111 sensors support Arjan van de Ven
2002-12-28 12:36 ` Christoph Hellwig
2003-01-05 17:44 ` [PATCH] i2c-isa and w83871d " GertJan Spoelman
2003-01-11 8:22 ` Christoph Hellwig [this message]
2003-01-05 19:34 ` [PATCH] amd756 and amd8111 " Pavel Machek
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=20030111082222.A20116@infradead.org \
--to=hch@infradead.org \
--cc=kl@gjs.cc \
--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