* [PATCH] platform/x86: asus_wmi: Fix return value of fan_boost_mode_store
@ 2020-03-04 11:38 Leonid Maksymchuk
0 siblings, 0 replies; only message in thread
From: Leonid Maksymchuk @ 2020-03-04 11:38 UTC (permalink / raw)
To: linux-kernel
Cc: corentin.chary, dvhart, andy, yurii.pavlovskyi, acpi4asus-user,
platform-driver-x86, Leonid Maksymchuk
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-03-04 11:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-04 11:38 [PATCH] platform/x86: asus_wmi: Fix return value of fan_boost_mode_store Leonid Maksymchuk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox