Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7df03b82ed081777d2393ff8a5fb9d4a3a560f26
Commit:     7df03b82ed081777d2393ff8a5fb9d4a3a560f26
Parent:     57ede701af3bc0c153070133e7831332ffa1d761
Author:     Mattia Dongili <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 13 23:04:41 2007 +0100
Committer:  Len Brown <[EMAIL PROTECTED]>
CommitDate: Tue Feb 13 03:06:44 2007 -0500

    sony_acpi: Fix sony_acpi backlight registration and unregistration
    
    Initialize the current brightness if the driver registration
    was successful and unregister the driver in the error exit path.
    
    Signed-off-by: Mattia Dongili <[EMAIL PROTECTED]>
    Signed-off-by: Len Brown <[EMAIL PROTECTED]>
---
 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 c65f589..c01d98d 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)
        if (ACPI_SUCCESS(acpi_get_handle(sony_acpi_handle, "GBRT", &handle))) {
                sony_backlight_device = backlight_device_register("sony", NULL,
                                        NULL, &sony_backlight_properties);
+
                if (IS_ERR(sony_backlight_device)) {
                        printk(LOG_PFX "unable to register backlight device\n");
+                       sony_backlight_device = NULL;
                }
+               else
+                       sony_backlight_properties.brightness =
+                               
sony_backlight_get_brightness(sony_backlight_device);
        }
 
        for (item = sony_acpi_values; item->name; ++item) {
@@ -400,6 +405,9 @@ static int sony_acpi_add(struct acpi_device *device)
        return 0;
 
 outproc:
+       if (sony_backlight_device)
+               backlight_device_unregister(sony_backlight_device);
+
        for (item = sony_acpi_values; item->name; ++item)
                if (item->proc)
                        remove_proc_entry(item->name, acpi_device_dir(device));
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to