Commit 7d5c89a6 authored by Thomas Renninger's avatar Thomas Renninger Committed by Len Brown

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

Signed-off-by: default avatarThomas Renninger <trenn@suse.de>
Acked-by: default avatarZhang Rui <rui.zhang@intel.com>
Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent a2bf8c01
......@@ -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 @@ static int __init fujitsu_init(void)
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment