[19/48] [PATCH] ideapad: Check if acpi already handle backlight power to avoid a page fault

From: Greg KH
Date: Mon Jan 16 2012 - 13:50:07 EST


3.1-stable review patch. If anyone has any objections, please let me know.

------------------

From: Rene Bollford <xsecute@xxxxxxxxxxxxxx>

commit d4afc7754a60b885b63ef23fd194984e2d53a4e6 upstream.

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@xxxxxxxxxxxxxx>
Signed-off-by: Matthew Garrett <mjg@xxxxxxxxxx>
Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
Tested-by: Artem X <artem.brz@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
drivers/platform/x86/ideapad-laptop.c | 2 ++
1 file changed, 2 insertions(+)

--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -493,6 +493,8 @@ static void ideapad_backlight_notify_pow
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;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/