|
|
@@ -72,14 +72,19 @@ static inline void superio_select(int ld)
|
|
|
superio_outb(0x07, ld);
|
|
|
}
|
|
|
|
|
|
-static inline void superio_enter(void)
|
|
|
+static inline int superio_enter(void)
|
|
|
{
|
|
|
+ if (!request_muxed_region(REG, 2, DRVNAME))
|
|
|
+ return -EBUSY;
|
|
|
+
|
|
|
outb(0x55, REG);
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
static inline void superio_exit(void)
|
|
|
{
|
|
|
outb(0xAA, REG);
|
|
|
+ release_region(REG, 2);
|
|
|
}
|
|
|
|
|
|
#define SUPERIO_REG_DEVID 0x20
|
|
|
@@ -300,8 +305,12 @@ static int __init smsc47b397_find(void)
|
|
|
u8 id, rev;
|
|
|
char *name;
|
|
|
unsigned short addr;
|
|
|
+ int err;
|
|
|
+
|
|
|
+ err = superio_enter();
|
|
|
+ if (err)
|
|
|
+ return err;
|
|
|
|
|
|
- superio_enter();
|
|
|
id = force_id ? force_id : superio_inb(SUPERIO_REG_DEVID);
|
|
|
|
|
|
switch (id) {
|