[PATCH V2 3/7] platform/x86: lg-laptop.c: Fix a bug in writing fan mode value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Simply write the desired value to the register. This seems to work,
unlike the previous complex method.

Signed-off-by: Matan Ziv-Av <matan@xxxxxxxxxxx>
---
 drivers/platform/x86/lg-laptop.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
index ab79457d5ffe..2f0ce69d8e31 100644
--- a/drivers/platform/x86/lg-laptop.c
+++ b/drivers/platform/x86/lg-laptop.c
@@ -298,9 +298,8 @@ static ssize_t fan_mode_store(struct device *dev,
 
 	m = r->integer.value;
 	kfree(r);
-	r = lg_wmab(WM_FAN_MODE, WM_SET, (m & 0xffffff0f) | (value << 4));
-	kfree(r);
-	r = lg_wmab(WM_FAN_MODE, WM_SET, (m & 0xfffffff0) | value);
+	r = lg_wmab(WM_FAN_MODE, WM_SET, (m & 0xffffff0f) |
+		    (value << 4) | value);
 	kfree(r);
 
 	return count;
-- 
2.21.0




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux