hwmon: (ftsteutates) Fix clearing alarm sysfs entries
authorThilo Cestonaro <thilo.cestonaro@ts.fujitsu.com>
Thu, 3 Aug 2017 09:43:51 +0000 (11:43 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 13 Aug 2017 15:24:01 +0000 (08:24 -0700)
sysfs store functions should return the number of bytes written.
Returning zero results in an endless loop.

Fixes: 08426eda58e0 ("hwmon: Add driver for FTS BMC chip "Teutates"")
Signed-off-by: Thilo Cestonaro <thilo.cestonaro@ts.fujitsu.com>
[groeck: Clean up documentation change and description]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Documentation/hwmon/ftsteutates
drivers/hwmon/ftsteutates.c

index 8c10a916de20d064a34fb43b121309b190eab98c..af54db92391bab26610150b2f2b20bcc081edc2d 100644 (file)
@@ -18,6 +18,10 @@ enhancements. It can monitor up to 4 voltages, 16 temperatures and
 8 fans. It also contains an integrated watchdog which is currently
 implemented in this driver.
 
+To clear a temperature or fan alarm, execute the following command with the
+correct path to the alarm file:
+       echo 0 >XXXX_alarm
+
 Specification of the chip can be found here:
 ftp://ftp.ts.fujitsu.com/pub/Mainboard-OEM-Sales/Services/Software&Tools/Linux_SystemMonitoring&Watchdog&GPIO/BMC-Teutates_Specification_V1.21.pdf
 ftp://ftp.ts.fujitsu.com/pub/Mainboard-OEM-Sales/Services/Software&Tools/Linux_SystemMonitoring&Watchdog&GPIO/Fujitsu_mainboards-1-Sensors_HowTo-en-US.pdf
index 0f0277e7aae5140015ed179cab6ef419800cd4c7..a0fb9e9291f023bb6a7c9471566a9bc35527a62b 100644 (file)
@@ -435,6 +435,7 @@ clear_temp_alarm(struct device *dev, struct device_attribute *devattr,
                goto error;
 
        data->valid = false;
+       ret = count;
 error:
        mutex_unlock(&data->update_lock);
        return ret;
@@ -508,6 +509,7 @@ clear_fan_alarm(struct device *dev, struct device_attribute *devattr,
                goto error;
 
        data->valid = false;
+       ret = count;
 error:
        mutex_unlock(&data->update_lock);
        return ret;