summaryrefslogtreecommitdiffstats
path: root/drivers/misc/fujitsu-laptop.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2008-11-11 21:15:50 -0500
committerLen Brown <len.brown@intel.com>2008-11-11 21:15:50 -0500
commitf398778aa336a2919ee04ba45d915007230c6957 (patch)
treec7244cd1d4af8d99c861b21ebcaeabf23e355b9f /drivers/misc/fujitsu-laptop.c
parent9b5a56ddfd615a27e3a0856ceae1592a24021e42 (diff)
parent2dba1b5d87e08a294da5cdfa4d32908000e9b085 (diff)
Merge branch 'video' into release
Conflicts: Documentation/kernel-parameters.txt Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc/fujitsu-laptop.c')
-rw-r--r--drivers/misc/fujitsu-laptop.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/misc/fujitsu-laptop.c b/drivers/misc/fujitsu-laptop.c
index 5ec77ae08d9..a7dd3e9fb79 100644
--- a/drivers/misc/fujitsu-laptop.c
+++ b/drivers/misc/fujitsu-laptop.c
@@ -1005,16 +1005,16 @@ static int __init fujitsu_init(void)
/* Register backlight stuff */
- fujitsu->bl_device =
- backlight_device_register("fujitsu-laptop", NULL, NULL,
- &fujitsubl_ops);
- if (IS_ERR(fujitsu->bl_device))
- return PTR_ERR(fujitsu->bl_device);
-
- max_brightness = fujitsu->max_brightness;
-
- fujitsu->bl_device->props.max_brightness = max_brightness - 1;
- fujitsu->bl_device->props.brightness = fujitsu->brightness_level;
+ if (!acpi_video_backlight_support()) {
+ fujitsu->bl_device =
+ backlight_device_register("fujitsu-laptop", NULL, NULL,
+ &fujitsubl_ops);
+ if (IS_ERR(fujitsu->bl_device))
+ return PTR_ERR(fujitsu->bl_device);
+ max_brightness = fujitsu->max_brightness;
+ fujitsu->bl_device->props.max_brightness = max_brightness - 1;
+ fujitsu->bl_device->props.brightness = fujitsu->brightness_level;
+ }
ret = platform_driver_register(&fujitsupf_driver);
if (ret)
@@ -1050,7 +1050,8 @@ fail_hotkey:
fail_backlight:
- backlight_device_unregister(fujitsu->bl_device);
+ if (fujitsu->bl_device)
+ backlight_device_unregister(fujitsu->bl_device);
fail_platform_device2:
@@ -1077,7 +1078,8 @@ static void __exit fujitsu_cleanup(void)
&fujitsupf_attribute_group);
platform_device_unregister(fujitsu->pf_device);
platform_driver_unregister(&fujitsupf_driver);
- backlight_device_unregister(fujitsu->bl_device);
+ if (fujitsu->bl_device)
+ backlight_device_unregister(fujitsu->bl_device);
acpi_bus_unregister_driver(&acpi_fujitsu_driver);