aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorGiel van Schijndel <me@mortis.eu>2010-05-27 13:58:43 -0400
committerJean Delvare <khali@linux-fr.org>2010-05-27 13:58:43 -0400
commit729d273aa7c86eb1406ade4eadf249cff188bf9a (patch)
treec79a0072d3b71c762db8ddbefa68ed54ea68ffa5 /drivers/hwmon
parentbd328acdc6160b95f5d7127a9df3172892f35627 (diff)
hwmon: (f71882fg) Acquire I/O regions while we're working with them
Acquire the I/O region for the Super I/O chip while we're working on it. Signed-off-by: Giel van Schijndel <me@mortis.eu> Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/f71882fg.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/hwmon/f71882fg.c b/drivers/hwmon/f71882fg.c
index ca34e5c48702..537841ef44b9 100644
--- a/drivers/hwmon/f71882fg.c
+++ b/drivers/hwmon/f71882fg.c
@@ -2178,6 +2178,13 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address,
2178 int err = -ENODEV; 2178 int err = -ENODEV;
2179 u16 devid; 2179 u16 devid;
2180 2180
2181 /* Don't step on other drivers' I/O space by accident */
2182 if (!request_region(sioaddr, 2, DRVNAME)) {
2183 printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n",
2184 (int)sioaddr);
2185 return -EBUSY;
2186 }
2187
2181 superio_enter(sioaddr); 2188 superio_enter(sioaddr);
2182 2189
2183 devid = superio_inw(sioaddr, SIO_REG_MANID); 2190 devid = superio_inw(sioaddr, SIO_REG_MANID);
@@ -2232,6 +2239,7 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address,
2232 (int)superio_inb(sioaddr, SIO_REG_DEVREV)); 2239 (int)superio_inb(sioaddr, SIO_REG_DEVREV));
2233exit: 2240exit:
2234 superio_exit(sioaddr); 2241 superio_exit(sioaddr);
2242 release_region(sioaddr, 2);
2235 return err; 2243 return err;
2236} 2244}
2237 2245