diff options
Diffstat (limited to 'drivers/platform/x86/fujitsu-laptop.c')
-rw-r--r-- | drivers/platform/x86/fujitsu-laptop.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index 5f3320d468f6..47b4fd75aa34 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c | |||
@@ -66,6 +66,7 @@ | |||
66 | #include <linux/kfifo.h> | 66 | #include <linux/kfifo.h> |
67 | #include <linux/video_output.h> | 67 | #include <linux/video_output.h> |
68 | #include <linux/platform_device.h> | 68 | #include <linux/platform_device.h> |
69 | #include <linux/slab.h> | ||
69 | #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) | 70 | #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) |
70 | #include <linux/leds.h> | 71 | #include <linux/leds.h> |
71 | #endif | 72 | #endif |
@@ -1126,16 +1127,20 @@ static int __init fujitsu_init(void) | |||
1126 | /* Register backlight stuff */ | 1127 | /* Register backlight stuff */ |
1127 | 1128 | ||
1128 | if (!acpi_video_backlight_support()) { | 1129 | if (!acpi_video_backlight_support()) { |
1129 | fujitsu->bl_device = | 1130 | struct backlight_properties props; |
1130 | backlight_device_register("fujitsu-laptop", NULL, NULL, | 1131 | |
1131 | &fujitsubl_ops); | 1132 | memset(&props, 0, sizeof(struct backlight_properties)); |
1133 | max_brightness = fujitsu->max_brightness; | ||
1134 | props.max_brightness = max_brightness - 1; | ||
1135 | fujitsu->bl_device = backlight_device_register("fujitsu-laptop", | ||
1136 | NULL, NULL, | ||
1137 | &fujitsubl_ops, | ||
1138 | &props); | ||
1132 | if (IS_ERR(fujitsu->bl_device)) { | 1139 | if (IS_ERR(fujitsu->bl_device)) { |
1133 | ret = PTR_ERR(fujitsu->bl_device); | 1140 | ret = PTR_ERR(fujitsu->bl_device); |
1134 | fujitsu->bl_device = NULL; | 1141 | fujitsu->bl_device = NULL; |
1135 | goto fail_sysfs_group; | 1142 | goto fail_sysfs_group; |
1136 | } | 1143 | } |
1137 | max_brightness = fujitsu->max_brightness; | ||
1138 | fujitsu->bl_device->props.max_brightness = max_brightness - 1; | ||
1139 | fujitsu->bl_device->props.brightness = fujitsu->brightness_level; | 1144 | fujitsu->bl_device->props.brightness = fujitsu->brightness_level; |
1140 | } | 1145 | } |
1141 | 1146 | ||