diff options
Diffstat (limited to 'drivers/platform/x86/thinkpad_acpi.c')
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index c64e3528889b..770b85327f84 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -6170,6 +6170,7 @@ static const struct tpacpi_quirk brightness_quirk_table[] __initconst = { | |||
6170 | 6170 | ||
6171 | static int __init brightness_init(struct ibm_init_struct *iibm) | 6171 | static int __init brightness_init(struct ibm_init_struct *iibm) |
6172 | { | 6172 | { |
6173 | struct backlight_properties props; | ||
6173 | int b; | 6174 | int b; |
6174 | unsigned long quirks; | 6175 | unsigned long quirks; |
6175 | 6176 | ||
@@ -6259,9 +6260,12 @@ static int __init brightness_init(struct ibm_init_struct *iibm) | |||
6259 | printk(TPACPI_INFO | 6260 | printk(TPACPI_INFO |
6260 | "detected a 16-level brightness capable ThinkPad\n"); | 6261 | "detected a 16-level brightness capable ThinkPad\n"); |
6261 | 6262 | ||
6262 | ibm_backlight_device = backlight_device_register( | 6263 | memset(&props, 0, sizeof(struct backlight_properties)); |
6263 | TPACPI_BACKLIGHT_DEV_NAME, NULL, NULL, | 6264 | props.max_brightness = (tp_features.bright_16levels) ? 15 : 7; |
6264 | &ibm_backlight_data); | 6265 | ibm_backlight_device = backlight_device_register(TPACPI_BACKLIGHT_DEV_NAME, |
6266 | NULL, NULL, | ||
6267 | &ibm_backlight_data, | ||
6268 | &props); | ||
6265 | if (IS_ERR(ibm_backlight_device)) { | 6269 | if (IS_ERR(ibm_backlight_device)) { |
6266 | int rc = PTR_ERR(ibm_backlight_device); | 6270 | int rc = PTR_ERR(ibm_backlight_device); |
6267 | ibm_backlight_device = NULL; | 6271 | ibm_backlight_device = NULL; |
@@ -6280,8 +6284,6 @@ static int __init brightness_init(struct ibm_init_struct *iibm) | |||
6280 | "or not on your ThinkPad\n", TPACPI_MAIL); | 6284 | "or not on your ThinkPad\n", TPACPI_MAIL); |
6281 | } | 6285 | } |
6282 | 6286 | ||
6283 | ibm_backlight_device->props.max_brightness = | ||
6284 | (tp_features.bright_16levels)? 15 : 7; | ||
6285 | ibm_backlight_device->props.brightness = b & TP_EC_BACKLIGHT_LVLMSK; | 6287 | ibm_backlight_device->props.brightness = b & TP_EC_BACKLIGHT_LVLMSK; |
6286 | backlight_update_status(ibm_backlight_device); | 6288 | backlight_update_status(ibm_backlight_device); |
6287 | 6289 | ||