linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ftsteutates: fix clear alarm sysfs entries
@ 2017-08-03  9:43 Thilo Cestonaro
  2017-08-08 13:54 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Thilo Cestonaro @ 2017-08-03  9:43 UTC (permalink / raw)
  To: linux-hwmon; +Cc: Thilo Cestonaro

sysfs store functions should return the "written" bytes.
Returning zero ends in an endless loop, so fix this by
returning the count of bytes got.

Signed-off-by: Thilo Cestonaro <thilo.cestonaro@ts.fujitsu.com>
---
 Documentation/hwmon/ftsteutates | 4 ++++
 drivers/hwmon/ftsteutates.c     | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/Documentation/hwmon/ftsteutates b/Documentation/hwmon/ftsteutates
index 8c10a916de20..6b5992f6072a 100644
--- a/Documentation/hwmon/ftsteutates
+++ b/Documentation/hwmon/ftsteutates
@@ -21,3 +21,7 @@ implemented in this driver.
 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
+
+to clear a temprature or fan alarm execute the following command with the
+correct path to the alarm file:
+echo 0 >XXXX_alarm
diff --git a/drivers/hwmon/ftsteutates.c b/drivers/hwmon/ftsteutates.c
index 0f0277e7aae5..a0fb9e9291f0 100644
--- a/drivers/hwmon/ftsteutates.c
+++ b/drivers/hwmon/ftsteutates.c
@@ -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;
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: ftsteutates: fix clear alarm sysfs entries
  2017-08-03  9:43 [PATCH] ftsteutates: fix clear alarm sysfs entries Thilo Cestonaro
@ 2017-08-08 13:54 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2017-08-08 13:54 UTC (permalink / raw)
  To: Thilo Cestonaro; +Cc: linux-hwmon

On Thu, Aug 03, 2017 at 11:43:51AM +0200, Thilo Cestonaro wrote:
> sysfs store functions should return the "written" bytes.
> Returning zero ends in an endless loop, so fix this by
> returning the count of bytes got.
> 
> Signed-off-by: Thilo Cestonaro <thilo.cestonaro@ts.fujitsu.com>

Applied, thanks (fixed documentation change and description).

Guenter

> ---
>  Documentation/hwmon/ftsteutates | 4 ++++
>  drivers/hwmon/ftsteutates.c     | 2 ++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/Documentation/hwmon/ftsteutates b/Documentation/hwmon/ftsteutates
> index 8c10a916de20..6b5992f6072a 100644
> --- a/Documentation/hwmon/ftsteutates
> +++ b/Documentation/hwmon/ftsteutates
> @@ -21,3 +21,7 @@ implemented in this driver.
>  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
> +
> +to clear a temprature or fan alarm execute the following command with the
> +correct path to the alarm file:
> +echo 0 >XXXX_alarm
> diff --git a/drivers/hwmon/ftsteutates.c b/drivers/hwmon/ftsteutates.c
> index 0f0277e7aae5..a0fb9e9291f0 100644
> --- a/drivers/hwmon/ftsteutates.c
> +++ b/drivers/hwmon/ftsteutates.c
> @@ -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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-08 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-03  9:43 [PATCH] ftsteutates: fix clear alarm sysfs entries Thilo Cestonaro
2017-08-08 13:54 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).