From patchwork Thu Aug 3 09:43:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thilo Cestonaro X-Patchwork-Id: 9878555 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CFC70603B4 for ; Thu, 3 Aug 2017 09:43:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF4CD28622 for ; Thu, 3 Aug 2017 09:43:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C29F12867D; Thu, 3 Aug 2017 09:43:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AD2C28622 for ; Thu, 3 Aug 2017 09:43:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751959AbdHCJn6 (ORCPT ); Thu, 3 Aug 2017 05:43:58 -0400 Received: from mail1.bemta3.messagelabs.com ([195.245.230.168]:15774 "EHLO mail1.bemta3.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751950AbdHCJn5 (ORCPT ); Thu, 3 Aug 2017 05:43:57 -0400 Received: from [195.245.230.51] by server-8.bemta-3.messagelabs.com id 39/97-02176-C50F2895; Thu, 03 Aug 2017 09:43:56 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCLMWRWlGSWpSXmKPExsViZ8MxRTf6Q1O kwcvN0hbtr7cyOjB6fN4kF8AYxZqZl5RfkcCa8XVOO3vBZ56Ke2tZGxg3c3cxcnEICRxllFi/ 7gRjFyMnkDOHUaL3nXUXIwcHm4CZxLf1hSBhEQF5ib5VPYwgYWYBE4mnq/1ATGEBa4nPn2xAK lgEVCVeP2xmAbF5BZwlPj04yA5iSwB17mq7yDqBkXMBI8MqRvXi1KKy1CJdM72kosz0jJLcxM wcXUMDY73c1OLixPTUnMSkYr3k/NxNjEAf1TMwMO5gvNLmfIhRkoNJSZS3+lhTpBBfUn5KZUZ icUZ8UWlOavEhRhkODiUJXt33QDnBotT01Iq0zBxgsMCkJTh4lER4f78DSvMWFyTmFmemQ6RO MepyvJrw/xuTEEtefl6qlDivHcgMAZCijNI8uBGwwL3EKCslzMvIwMAgxFOQWpSbWYIq/4pRn INRSZi3DWQKT2ZeCdymV0BHMAEd8aeuEeSIkkSElFQDo62rqKKWiPAMnylWO07dXVn87eQp7f tLUi+ZXTJ6EbZkpVJMsNjTib/7Jp/cKpFdoOVWPG9xNo/H4g8KLL+yz/Z/ZJrR6HrffqO5JGO DVUuJYsnHDPsYN/Yfut3/T5wOOe8uY16d4LfY6fr0x0Gnso2lWFM0vzyRvzKRoVrhZfN2h6aD kr0blFiKMxINtZiLihMB5cPhcVcCAAA= X-Env-Sender: thilo.cestonaro@ts.fujitsu.com X-Msg-Ref: server-8.tower-33.messagelabs.com!1501753435!98292898!1 X-Originating-IP: [62.60.8.148] X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 1275 invoked from network); 3 Aug 2017 09:43:55 -0000 Received: from unknown (HELO mailhost1.uk.fujitsu.com) (62.60.8.148) by server-8.tower-33.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 3 Aug 2017 09:43:55 -0000 Received: from abgdgate60u.abg.fsc.net ([172.25.138.90]) by mailhost1.uk.fujitsu.com (8.14.5/8.14.5) with ESMTP id v739ht0S018846 for ; Thu, 3 Aug 2017 10:43:55 +0100 Received: from abg4858n-lnx.abg.fsc.net (HELO abg4858n-lnx.CSOD.local) ([172.26.71.103]) by abgdgate60u.abg.fsc.net with ESMTP; 03 Aug 2017 11:43:54 +0200 From: Thilo Cestonaro To: linux-hwmon@vger.kernel.org Cc: Thilo Cestonaro Subject: [PATCH] ftsteutates: fix clear alarm sysfs entries Date: Thu, 3 Aug 2017 11:43:51 +0200 Message-Id: <20170803094351.10325-1-thilo.cestonaro@ts.fujitsu.com> X-Mailer: git-send-email 2.11.0 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;