Force chip ID only if a chip has been found

If the reported chip ID is 0xffff, there is no chip, and forcing the chip
type does not add value.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Guenter Roeck
2017-03-14 09:33:52 -07:00
parent 206f865f2e
commit 93d58d34ac

7
it87.c
View File

@@ -2421,7 +2421,12 @@ static int __init it87_find(int sioaddr, unsigned short *address,
return err;
err = -ENODEV;
chip_type = force_id ? force_id : superio_inw(sioaddr, DEVID);
chip_type = superio_inw(sioaddr, DEVID);
if (chip_type == 0xffff)
goto exit;
if (force_id)
chip_type = force_id;
switch (chip_type) {
case IT8705F_DEVID: