From e3c740e8b4c727b75d124334ea9dfc3156cd8e83 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Thu, 14 Jun 2012 09:42:39 -0700 Subject: [PATCH] Improve error return from clear_caseopen Signed-off-by: Guenter Roeck --- nct6775.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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[] = { -- 2.39.5