[PATCH 3/7] Fix bug in writing fan mode value

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

 



The new writing method is simpler, and appears to work in all cases.

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

diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
index ab79457d5ffe..467143394ca9 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