sony-laptop: Fix reporting of gfx_switch_status
authorDaniel Serpell <daniel.serpell@gmail.com>
Sat, 10 Aug 2013 04:11:19 +0000 (13:11 +0900)
committerMatthew Garrett <matthew.garrett@nebula.com>
Sun, 18 Aug 2013 17:23:09 +0000 (13:23 -0400)
Signed-off-by: Daniel Serpell <daniel.serpell@gmail.com>
Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
drivers/platform/x86/sony-laptop.c

index b162733..3a1b6bf 100644 (file)
@@ -2440,7 +2440,10 @@ static ssize_t sony_nc_gfx_switch_status_show(struct device *dev,
        if (pos < 0)
                return pos;
 
-       return snprintf(buffer, PAGE_SIZE, "%s\n", pos ? "speed" : "stamina");
+       return snprintf(buffer, PAGE_SIZE, "%s\n",
+                                       pos == SPEED ? "speed" :
+                                       pos == STAMINA ? "stamina" :
+                                       pos == AUTO ? "auto" : "unknown");
 }
 
 static int sony_nc_gfx_switch_setup(struct platform_device *pd,