Skip to contentSkip to conversation

acer-wmi: does not allow negative number set to initial device state

PATCH New Lee, Chun-Yi 1 participant 1 message Apr 15, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acer-wmi: does not allow negative number set to initial device state

The driver set module parameter value: mailled, threeg and brightness to BIOS by evaluate wmi method when driver was initialed. The default values for those parameters are -1, so, that will be better don't set negative value to BIOS.

Cc Carlos Corbacho <[email protected]>
Cc Matthew Garrett <[email protected]>
Cc Dmitry Torokhov <[email protected]>
Cc Corentin Chary <[email protected]>
---
 drivers/platform/x86/acer-wmi.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/platform/x86/acer-wmi.c +5 -3
index ac4e7f8..c3cb603 100644
@@ -961,10 +961,12 @@ static void __init acer_commandline_init(void)
 	 * These will all fail silently if the value given is invalid, or the
 	 * capability isn't available on the given interface
 	 */
-	set_u32(mailled, ACER_CAP_MAILLED);
-	if (!has_type_aa)
+	if (mailled >= 0)
+		set_u32(mailled, ACER_CAP_MAILLED);
+	if (!has_type_aa && threeg >= 0)
 		set_u32(threeg, ACER_CAP_THREEG);
-	set_u32(brightness, ACER_CAP_BRIGHTNESS);
+	if (brightness >= 0)
+		set_u32(brightness, ACER_CAP_BRIGHTNESS);
 }
 
 /*
Signature · 1 line
1.6.0.2