[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100324102942.215ee413@hyperion.delvare>
Date: Wed, 24 Mar 2010 10:29:42 +0100
From: Jean Delvare <khali@...ux-fr.org>
To: Giel van Schijndel <me@...tis.eu>
Cc: Hans de Goede <hdegoede@...hat.com>,
Jonathan Cameron <jic23@....ac.uk>,
Laurens Leemans <laurens@...nips.com>,
lm-sensors@...sensors.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hwmon: f71882fg: properly acquire I/O regions while
probing
On Tue, 23 Mar 2010 15:12:15 +0100, Giel van Schijndel wrote:
> Acquire the I/O region for the Super I/O chip while we're working on it.
>
> Further alter the way multiple Super I/O addresses are probed for chips
> such that errors in the probing process are passed on from the module
> initialisation function.
>
> Some code cleanup: properly using, previously defined, functions rather
> than duplicating their code.
> (...)
On top of Hans' comments, to which I agree:
> static u16 f71882fg_read_temp(struct f71882fg_data *data, int nr)
> @@ -2184,6 +2178,13 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address,
> int err = -ENODEV;
> u16 devid;
>
> + /* Don't step on other driver's I/O space by accident */
> + if (!request_region(sioaddr, 2, DRVNAME)) {
> + printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n",
> + (int)sioaddr);
> + return -EIO;
This is the wrong error code. This isn't an I/O error. You want -EBUSY.
> + }
> +
> superio_enter(sioaddr);
>
> devid = superio_inw(sioaddr, SIO_REG_MANID);
--
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists