fujitsu-laptop: fingers off backlight if video.ko is serving this functionality

Signed-off-by: Thomas Renninger <trenn@suse.de>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
Thomas Renninger 2008-08-01 17:38:00 +02:00 committed by Len Brown
parent a2bf8c0104
commit 7d5c89a615

View File

@ -990,16 +990,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)
@ -1035,7 +1035,8 @@ fail_hotkey:
fail_backlight:
backlight_device_unregister(fujitsu->bl_device);
if (fujitsu->bl_device)
backlight_device_unregister(fujitsu->bl_device);
fail_platform_device2:
@ -1062,7 +1063,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);