aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2008-08-01 11:38:00 -0400
committerLen Brown <len.brown@intel.com>2008-11-08 00:27:27 -0500
commit7d5c89a615c5dae039094a3cf4a56fe6aab81765 (patch)
tree75b1a919b9d579f1f0ca71bd71139735e115b457
parenta2bf8c01048f855fbf65a8fc41460aef71ca39dc (diff)
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>
-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 d2cf0bfe3163..1070dc1bc18e 100644
--- a/drivers/misc/fujitsu-laptop.c
+++ b/drivers/misc/fujitsu-laptop.c
@@ -990,16 +990,16 @@ static int __init fujitsu_init(void)
990 990
991 /* Register backlight stuff */ 991 /* Register backlight stuff */
992 992
993 fujitsu->bl_device = 993 if (!acpi_video_backlight_support()) {
994 backlight_device_register("fujitsu-laptop", NULL, NULL, 994 fujitsu->bl_device =
995 &fujitsubl_ops); 995 backlight_device_register("fujitsu-laptop", NULL, NULL,
996 if (IS_ERR(fujitsu->bl_device)) 996 &fujitsubl_ops);
997 return PTR_ERR(fujitsu->bl_device); 997 if (IS_ERR(fujitsu->bl_device))
998 998 return PTR_ERR(fujitsu->bl_device);
999 max_brightness = fujitsu->max_brightness; 999 max_brightness = fujitsu->max_brightness;
1000 1000 fujitsu->bl_device->props.max_brightness = max_brightness - 1;
1001 fujitsu->bl_device->props.max_brightness = max_brightness - 1; 1001 fujitsu->bl_device->props.brightness = fujitsu->brightness_level;
1002 fujitsu->bl_device->props.brightness = fujitsu->brightness_level; 1002 }
1003 1003
1004 ret = platform_driver_register(&fujitsupf_driver); 1004 ret = platform_driver_register(&fujitsupf_driver);
1005 if (ret) 1005 if (ret)
@@ -1035,7 +1035,8 @@ fail_hotkey:
1035 1035
1036fail_backlight: 1036fail_backlight:
1037 1037
1038 backlight_device_unregister(fujitsu->bl_device); 1038 if (fujitsu->bl_device)
1039 backlight_device_unregister(fujitsu->bl_device);
1039 1040
1040fail_platform_device2: 1041fail_platform_device2:
1041 1042
@@ -1062,7 +1063,8 @@ static void __exit fujitsu_cleanup(void)
1062 &fujitsupf_attribute_group); 1063 &fujitsupf_attribute_group);
1063 platform_device_unregister(fujitsu->pf_device); 1064 platform_device_unregister(fujitsu->pf_device);
1064 platform_driver_unregister(&fujitsupf_driver); 1065 platform_driver_unregister(&fujitsupf_driver);
1065 backlight_device_unregister(fujitsu->bl_device); 1066 if (fujitsu->bl_device)
1067 backlight_device_unregister(fujitsu->bl_device);
1066 1068
1067 acpi_bus_unregister_driver(&acpi_fujitsu_driver); 1069 acpi_bus_unregister_driver(&acpi_fujitsu_driver);
1068 1070