All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] acer-wmi: does not allow negative number set to initial device state
@ 2011-04-15 10:42 Lee, Chun-Yi
  0 siblings, 0 replies; only message in thread
From: Lee, Chun-Yi @ 2011-04-15 10:42 UTC (permalink / raw)
  To: carlos
  Cc: platform-driver-x86, Lee, Chun-Yi, Matthew Garrett,
	Dmitry Torokhov, Corentin Chary

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 <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
---
 drivers/platform/x86/acer-wmi.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index ac4e7f8..c3cb603 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -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);
 }
 
 /*
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-04-15 10:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-15 10:42 [PATCH] acer-wmi: does not allow negative number set to initial device state Lee, Chun-Yi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.