mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 02:39:48 +00:00
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>
This commit is contained in:
parent
bd328acdc6
commit
729d273aa7
1 changed files with 8 additions and 0 deletions
|
@ -2178,6 +2178,13 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address,
|
|||
int err = -ENODEV;
|
||||
u16 devid;
|
||||
|
||||
/* Don't step on other drivers' 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 -EBUSY;
|
||||
}
|
||||
|
||||
superio_enter(sioaddr);
|
||||
|
||||
devid = superio_inw(sioaddr, SIO_REG_MANID);
|
||||
|
@ -2232,6 +2239,7 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address,
|
|||
(int)superio_inb(sioaddr, SIO_REG_DEVREV));
|
||||
exit:
|
||||
superio_exit(sioaddr);
|
||||
release_region(sioaddr, 2);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue