public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Thilo Cestonaro <thilo.cestonaro@ts.fujitsu.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: ftsteutates: fix clear alarm sysfs entries
Date: Tue, 8 Aug 2017 06:54:57 -0700	[thread overview]
Message-ID: <20170808135457.GA15751@roeck-us.net> (raw)
In-Reply-To: <20170803094351.10325-1-thilo.cestonaro@ts.fujitsu.com>

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;

      reply	other threads:[~2017-08-08 13:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-03  9:43 [PATCH] ftsteutates: fix clear alarm sysfs entries Thilo Cestonaro
2017-08-08 13:54 ` Guenter Roeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170808135457.GA15751@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=thilo.cestonaro@ts.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox