From: Leonid Maksymchuk <leonmaxx@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: corentin.chary@gmail.com, dvhart@infradead.org,
andy@infradead.org, yurii.pavlovskyi@gmail.com,
acpi4asus-user@lists.sourceforge.net,
platform-driver-x86@vger.kernel.org,
Leonid Maksymchuk <leonmaxx@gmail.com>
Subject: [PATCH] platform/x86: asus_wmi: Fix return value of fan_boost_mode_store
Date: Wed, 4 Mar 2020 13:38:11 +0200 [thread overview]
Message-ID: <20200304113811.31988-1-leonmaxx@gmail.com> (raw)
Function fan_boost_mode_store returns 0 if store is successful,
this leads to infinite loop after any write to it's sysfs entry:
# echo 0 >/sys/devices/platform/asus-nb-wmi/fan_boost_mode
This command never ends, one CPU core is at 100% utilization.
This patch fixes this by returning size of written data.
Fixes: b096f626a682 ("platform/x86: asus-wmi: Switch fan boost mode")
Signed-off-by: Leonid Maksymchuk <leonmaxx@gmail.com>
---
drivers/platform/x86/asus-wmi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 612ef5526226..e5d35987c048 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1719,7 +1719,7 @@ static ssize_t fan_boost_mode_store(struct device *dev,
asus->fan_boost_mode = new_mode;
fan_boost_mode_write(asus);
- return result;
+ return count;
}
// Fan boost mode: 0 - normal, 1 - overboost, 2 - silent
--
2.25.1
reply other threads:[~2020-03-04 11:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200304113811.31988-1-leonmaxx@gmail.com \
--to=leonmaxx@gmail.com \
--cc=acpi4asus-user@lists.sourceforge.net \
--cc=andy@infradead.org \
--cc=corentin.chary@gmail.com \
--cc=dvhart@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=yurii.pavlovskyi@gmail.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