[PATCH 19/21] ACPI: ibm-acpi: work around backlight poweroff on module removal

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

 



From: Henrique de Moraes Holschuh <hmh@xxxxxxxxxx>

This patch  works around an annoying behaviour in the backlight class, that
would reset the screen to brightness and power level 0 on module unload.

Please refer to http://thread.gmane.org/gmane.linux.acpi.devel/19712 for
details.

Signed-off-by: Henrique de Moraes Holschuh <hmh@xxxxxxxxxx>
---

 drivers/acpi/ibm_acpi.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index dab3fd1..4299f43 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -1732,6 +1732,13 @@ static int brightness_init(void)
 static void brightness_exit(void)
 {
 	if (ibm_backlight_device) {
+		/* FIXME: can be removed when sanity returns to backlight_device_unregister */
+		if (likely(ibm_backlight_device->props)) {
+			down(&ibm_backlight_device->sem);
+			ibm_backlight_device->props->update_status = NULL;
+			up(&ibm_backlight_device->sem);
+		}
+
 		backlight_device_unregister(ibm_backlight_device);
 		ibm_backlight_device = NULL;
 	}

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
ibm-acpi-devel mailing list
ibm-acpi-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel

[Index of Archives]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite Photos]     [Yosemite Advice]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux