]> git.sur5r.net Git - groeck-it87/commitdiff
Force chip ID only if a chip has been found
authorGuenter Roeck <linux@roeck-us.net>
Tue, 14 Mar 2017 16:33:52 +0000 (09:33 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 14 Mar 2017 17:11:31 +0000 (10:11 -0700)
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>
it87.c

diff --git a/it87.c b/it87.c
index 850f1764bb2c37e2aa375cdb612166363c496b81..5a96c5c879ba2ad54954970859f86ac153914cb1 100644 (file)
--- a/it87.c
+++ b/it87.c
@@ -2421,7 +2421,12 @@ static int __init it87_find(int sioaddr, unsigned short *address,
                return err;
 
        err = -ENODEV;
                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:
 
        switch (chip_type) {
        case IT8705F_DEVID: