提交 7d5c89a6 编写于 作者: T Thomas Renninger 提交者: Len Brown

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

Signed-off-by: NThomas Renninger <trenn@suse.de>
Acked-by: NZhang Rui <rui.zhang@intel.com>
Signed-off-by: NAndi Kleen <ak@linux.intel.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册