From: Guenter Roeck Date: Thu, 14 Jun 2012 16:42:39 +0000 (-0700) Subject: Improve error return from clear_caseopen X-Git-Tag: nct6775-v0.9~13 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e3c740e8b4c727b75d124334ea9dfc3156cd8e83;p=groeck-nct6775 Improve error return from clear_caseopen Signed-off-by: Guenter Roeck --- diff --git a/nct6775.c b/nct6775.c index 2864017..85da428 100644 --- 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[] = {