]> git.sur5r.net Git - groeck-nct6775/blobdiff - nct6775.c
hwmon: (nct6775) Do not accept force_id unless chip is found
[groeck-nct6775] / nct6775.c
index 36cd1e487f11432dc2af2097beecbccaea567992..068fb9bb950bd49dd8b7385411bda2b9ca1c9eb3 100644 (file)
--- a/nct6775.c
+++ b/nct6775.c
@@ -4277,11 +4277,11 @@ static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data)
        if (err)
                return err;
 
-       if (force_id)
+       val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) |
+               superio_inb(sioaddr, SIO_REG_DEVID + 1);
+       if (force_id && val != 0xffff)
                val = force_id;
-       else
-               val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8)
-                   | superio_inb(sioaddr, SIO_REG_DEVID + 1);
+
        switch (val & SIO_ID_MASK) {
        case SIO_NCT6106_ID:
                sio_data->kind = nct6106;