From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: Albert Cranford <ac9410@attbi.com>
Cc: Linus Torvalds <torvalds@transmeta.com>,
Kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [patch 2/9]Four new i2c drivers and __init/__exit cleanup to i2c
Date: Sun, 15 Sep 2002 19:00:46 -0400 [thread overview]
Message-ID: <3D85111E.5030509@mandrakesoft.com> (raw)
In-Reply-To: Pine.LNX.4.44.0209151834280.7637-200000@home1
Albert Cranford wrote:
> +#ifdef MODULE_LICENSE
> +MODULE_LICENSE("GPL");
> +#endif
kill the ifdef
> +static int bit_pport_init(void)
> +{
> + //release_region( (base+2) ,1);
> +
> + if (check_region((base+2),1) < 0 ) {
wrong. race. use request_region, and check its return value.
check_region should never be used.
> + return -ENODEV;
> + } else {
> +
> + /* test for PPORT adap. */
> +
> +
> + PortData=inb(base+2);
> + PortData= (PortData SET_SDA) SET_SCL;
> + outb(PortData,base+2);
> +
> + if (!(inb(base+2) | 0x06)) { /* SDA and SCL will be high */
> + DEBINIT(printk("i2c-pport.o: SDA and SCL was low.\n"));
> + return -ENODEV;
> + } else {
> +
> + /*SCL high and SDA low*/
> + PortData = PortData SET_SCL CLR_SDA;
> + outb(PortData,base+2);
> + udelay(400);
long udelay in process context, where you should sleep instead
> +static void bit_pport_inc_use(struct i2c_adapter *adap)
> +{
> +#ifdef MODULE
> + MOD_INC_USE_COUNT;
> +#endif
> +}
> +
> +static void bit_pport_dec_use(struct i2c_adapter *adap)
> +{
> +#ifdef MODULE
> + MOD_DEC_USE_COUNT;
> +#endif
kill the ifdef. use ->owner instead if possible.
> +#ifdef MODULE
> +MODULE_AUTHOR("Daniel Smolik <marvin@sitour.cz>");
> +MODULE_DESCRIPTION("I2C-Bus adapter routines for Primitive parallel port adapter")
> +;
> +
> +MODULE_PARM(base, "i");
> +
> +int init_module(void)
> +{
> + return i2c_bitpport_init();
> +}
> +
> +void cleanup_module(void)
> +{
> + i2c_bit_del_bus(&bit_pport_ops);
> + bit_pport_exit();
> +}
> +
> +#endif
kill the ifdef, use module_init, module_exit
next prev parent reply other threads:[~2002-09-15 22:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-15 22:36 [patch 2/9]Four new i2c drivers and __init/__exit cleanup to i2c Albert Cranford
2002-09-15 23:00 ` Jeff Garzik [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-05-19 6:23 Albert Cranford
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=3D85111E.5030509@mandrakesoft.com \
--to=jgarzik@mandrakesoft.com \
--cc=ac9410@attbi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.