Patchwork ideapad: Check if acpi already handle backlight power in 'ideapad_backlight_notify_power' to avoid a page fault

login
register
mail settings
Submitter Ike Panhc
Date Sept. 11, 2011, 6:09 a.m.
Message ID <1315721380-14355-1-git-send-email-ike.pan@canonical.com>
Download mbox | patch
Permalink /patch/114209/
State New
Headers show

Comments

Ike Panhc - Sept. 11, 2011, 6:09 a.m.
From: Rene Bolldorf <xsecute@googlemail.com>

This patch avoid a page fault in the ideapad-laptop extras when
turning the backlight power on or off.

Signed-off-by: Rene Bolldorf <xsecute@googlemail.com>
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
---
 drivers/platform/x86/ideapad-laptop.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 0c59541..0d94eec 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -493,6 +493,8 @@  static void ideapad_backlight_notify_power(struct ideapad_private *priv)
 	unsigned long power;
 	struct backlight_device *blightdev = priv->blightdev;
 
+	if (!blightdev)
+		return;
 	if (read_ec_data(ideapad_handle, 0x18, &power))
 		return;
 	blightdev->props.power = power ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;