sony-laptop: fix bogus error message display on resume
authorMattia Dongili <malattia@linux.it>
Sun, 12 Apr 2009 11:26:30 +0000 (11:26 +0000)
committerLen Brown <len.brown@intel.com>
Fri, 24 Apr 2009 03:57:34 +0000 (23:57 -0400)
sony_backlight_update_status returns 0 on success -1 on failure (i.e.: the
return value from acpi_callsetfunc. The return value in the resume path
was broken and thus always displaying a bogus warning about not being able
to restore the brightness level.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/platform/x86/sony-laptop.c

index 3541ca097d09c0791d9a53cf2d537062ea37fee1..d93cff656c9984a487980652f77dc252fcb52137 100644 (file)
@@ -1041,7 +1041,7 @@ static int sony_nc_resume(struct acpi_device *device)
 
        /* set the last requested brightness level */
        if (sony_backlight_device &&
-                       !sony_backlight_update_status(sony_backlight_device))
+                       sony_backlight_update_status(sony_backlight_device) < 0)
                printk(KERN_WARNING DRV_PFX "unable to restore brightness level\n");
 
        return 0;