[PATCH]: Check if acpi already handle backlight power in 'ideapad_backlight_notify_power' to avoid a page fault

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

 



Hi Matthew,

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>
---
diff --git a/drivers/platform/x86/ideapad-laptop.c
b/drivers/platform/x86/ideapad-laptop.c
index 0c59541..0766a9f 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -491,11 +491,13 @@ static void ideapad_backlight_exit(struct
ideapad_private *priv)
 static void ideapad_backlight_notify_power(struct ideapad_private *priv)
 {
        unsigned long power;
-       struct backlight_device *blightdev = priv->blightdev;

-       if (read_ec_data(ideapad_handle, 0x18, &power))
+       if (priv->blightdev == NULL) {
+               read_ec_data(ideapad_handle, 0x18, &power);
                return;
-       blightdev->props.power = power ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
+       }
+
+       priv->blightdev->props.power = power ? FB_BLANK_UNBLANK :
FB_BLANK_POWERDOWN;
 }

 static void ideapad_backlight_notify_brightness(struct ideapad_private *priv)
--
--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux