diff options
Diffstat (limited to 'drivers/acpi/sony_acpi.c')
-rw-r--r-- | drivers/acpi/sony_acpi.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/acpi/sony_acpi.c b/drivers/acpi/sony_acpi.c index c65f5893e0e2..c01d98db2fc1 100644 --- a/drivers/acpi/sony_acpi.c +++ b/drivers/acpi/sony_acpi.c | |||
@@ -354,9 +354,14 @@ static int sony_acpi_add(struct acpi_device *device) | |||
354 | if (ACPI_SUCCESS(acpi_get_handle(sony_acpi_handle, "GBRT", &handle))) { | 354 | if (ACPI_SUCCESS(acpi_get_handle(sony_acpi_handle, "GBRT", &handle))) { |
355 | sony_backlight_device = backlight_device_register("sony", NULL, | 355 | sony_backlight_device = backlight_device_register("sony", NULL, |
356 | NULL, &sony_backlight_properties); | 356 | NULL, &sony_backlight_properties); |
357 | |||
357 | if (IS_ERR(sony_backlight_device)) { | 358 | if (IS_ERR(sony_backlight_device)) { |
358 | printk(LOG_PFX "unable to register backlight device\n"); | 359 | printk(LOG_PFX "unable to register backlight device\n"); |
360 | sony_backlight_device = NULL; | ||
359 | } | 361 | } |
362 | else | ||
363 | sony_backlight_properties.brightness = | ||
364 | sony_backlight_get_brightness(sony_backlight_device); | ||
360 | } | 365 | } |
361 | 366 | ||
362 | for (item = sony_acpi_values; item->name; ++item) { | 367 | for (item = sony_acpi_values; item->name; ++item) { |
@@ -400,6 +405,9 @@ static int sony_acpi_add(struct acpi_device *device) | |||
400 | return 0; | 405 | return 0; |
401 | 406 | ||
402 | outproc: | 407 | outproc: |
408 | if (sony_backlight_device) | ||
409 | backlight_device_unregister(sony_backlight_device); | ||
410 | |||
403 | for (item = sony_acpi_values; item->name; ++item) | 411 | for (item = sony_acpi_values; item->name; ++item) |
404 | if (item->proc) | 412 | if (item->proc) |
405 | remove_proc_entry(item->name, acpi_device_dir(device)); | 413 | remove_proc_entry(item->name, acpi_device_dir(device)); |