lkml.org 
[lkml]   [2010]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2010-03-24 10:31    [W:0.150 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site