diff mbox series

[RFC,1/3] platform/x86: asus_wmi: Fix return value of fan_boost_mode_store

Message ID CAPW-Pu0qCfNXwjDW90To5ZpwtfpXAzm93CWFaUvA_9YQW5Ke-g@mail.gmail.com (mailing list archive)
State Not Applicable, archived
Delegated to: Andy Shevchenko
Headers show
Series asus_wmi: Support of ASUS TUF laptops on Ryzen CPUs | expand

Commit Message

Leonid Maksymchuk Nov. 4, 2019, 10:54 a.m. UTC
Function fan_boost_mode_store should return number of bytes written
but instead it returns return value of kstrtou8 which is 0 if
conversion is succefull. This leads to infinite loop after any
write to it's SysFS entry.

Signed-off-by: Leonid Maksymchuk <leonmaxx@gmail.com>
---
 drivers/platform/x86/asus-wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko Nov. 4, 2019, 2:31 p.m. UTC | #1
On Mon, Nov 4, 2019 at 12:54 PM Leon Maxx <leonmaxx@gmail.com> wrote:
>
> Function fan_boost_mode_store should return number of bytes written
> but instead it returns return value of kstrtou8 which is 0 if
> conversion is succefull. This leads to infinite loop after any
> write to it's SysFS entry.
>

Fixes tag missing.

> 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 821b08e..723aa4d 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -1718,7 +1718,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
> --
> 1.8.3.1
diff mbox series

Patch

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 821b08e..723aa4d 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1718,7 +1718,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