diff options
Diffstat (limited to 'drivers/misc/fujitsu-laptop.c')
-rw-r--r-- | drivers/misc/fujitsu-laptop.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/misc/fujitsu-laptop.c b/drivers/misc/fujitsu-laptop.c index 5ec77ae08d92..a7dd3e9fb79d 100644 --- a/drivers/misc/fujitsu-laptop.c +++ b/drivers/misc/fujitsu-laptop.c | |||
@@ -1005,16 +1005,16 @@ static int __init fujitsu_init(void) | |||
1005 | 1005 | ||
1006 | /* Register backlight stuff */ | 1006 | /* Register backlight stuff */ |
1007 | 1007 | ||
1008 | fujitsu->bl_device = | 1008 | if (!acpi_video_backlight_support()) { |
1009 | backlight_device_register("fujitsu-laptop", NULL, NULL, | 1009 | fujitsu->bl_device = |
1010 | &fujitsubl_ops); | 1010 | backlight_device_register("fujitsu-laptop", NULL, NULL, |
1011 | if (IS_ERR(fujitsu->bl_device)) | 1011 | &fujitsubl_ops); |
1012 | return PTR_ERR(fujitsu->bl_device); | 1012 | if (IS_ERR(fujitsu->bl_device)) |
1013 | 1013 | return PTR_ERR(fujitsu->bl_device); | |
1014 | max_brightness = fujitsu->max_brightness; | 1014 | max_brightness = fujitsu->max_brightness; |
1015 | 1015 | fujitsu->bl_device->props.max_brightness = max_brightness - 1; | |
1016 | fujitsu->bl_device->props.max_brightness = max_brightness - 1; | 1016 | fujitsu->bl_device->props.brightness = fujitsu->brightness_level; |
1017 | fujitsu->bl_device->props.brightness = fujitsu->brightness_level; | 1017 | } |
1018 | 1018 | ||
1019 | ret = platform_driver_register(&fujitsupf_driver); | 1019 | ret = platform_driver_register(&fujitsupf_driver); |
1020 | if (ret) | 1020 | if (ret) |
@@ -1050,7 +1050,8 @@ fail_hotkey: | |||
1050 | 1050 | ||
1051 | fail_backlight: | 1051 | fail_backlight: |
1052 | 1052 | ||
1053 | backlight_device_unregister(fujitsu->bl_device); | 1053 | if (fujitsu->bl_device) |
1054 | backlight_device_unregister(fujitsu->bl_device); | ||
1054 | 1055 | ||
1055 | fail_platform_device2: | 1056 | fail_platform_device2: |
1056 | 1057 | ||
@@ -1077,7 +1078,8 @@ static void __exit fujitsu_cleanup(void) | |||
1077 | &fujitsupf_attribute_group); | 1078 | &fujitsupf_attribute_group); |
1078 | platform_device_unregister(fujitsu->pf_device); | 1079 | platform_device_unregister(fujitsu->pf_device); |
1079 | platform_driver_unregister(&fujitsupf_driver); | 1080 | platform_driver_unregister(&fujitsupf_driver); |
1080 | backlight_device_unregister(fujitsu->bl_device); | 1081 | if (fujitsu->bl_device) |
1082 | backlight_device_unregister(fujitsu->bl_device); | ||
1081 | 1083 | ||
1082 | acpi_bus_unregister_driver(&acpi_fujitsu_driver); | 1084 | acpi_bus_unregister_driver(&acpi_fujitsu_driver); |
1083 | 1085 | ||