]> git.sur5r.net Git - groeck-nct6775/commitdiff
Improve error return from clear_caseopen
authorGuenter Roeck <linux@roeck-us.net>
Thu, 14 Jun 2012 16:42:39 +0000 (09:42 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 14 Jun 2012 16:42:39 +0000 (09:42 -0700)
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
nct6775.c

index 2864017d2fc05dfc2292c42506ac2ed84f186af1..85da428a4cd606e248b96823299ebcea18dfea2c 100644 (file)
--- a/nct6775.c
+++ b/nct6775.c
@@ -2909,8 +2909,10 @@ clear_caseopen(struct device *dev, struct device_attribute *attr,
         * support clearing the caseopen status through "regular" registers.
         */
        ret = superio_enter(sio_data->sioreg);
-       if (ret)
+       if (ret) {
+               count = ret;
                goto error;
+       }
 
        superio_select(sio_data->sioreg, NCT6775_LD_ACPI);
        reg = superio_inb(sio_data->sioreg, NCT6775_REG_CR_CASEOPEN_CLR[nr]);
@@ -2921,11 +2923,9 @@ clear_caseopen(struct device *dev, struct device_attribute *attr,
        superio_exit(sio_data->sioreg);
 
        data->valid = 0;        /* Force cache refresh */
-       ret = count;
 error:
        mutex_unlock(&data->update_lock);
-
-       return ret;
+       return count;
 }
 
 static struct sensor_device_attribute sda_caseopen[] = {