Skip to contentSkip to conversation

sony-laptop fixes for 3.10

PATCH New Mattia Dongili 1 participant 3 messages May 28, 2013

Subsystems (2)
lore
Share & tools
lore

Mattia Dongili

author maintainer
#0 lore raw

cover sony-laptop fixes for 3.10

Hi Matthew,
a couple of small fixes for sony-laptop, one for a bug in reporting the gfx_switch status, the other is a minor fix for returning meaningful values on error path in sonypi_compat_init.

Daniel Serpell (1):
Fix reporting of sony-laptop gfx_switch_status.

Wei Yongjun (1):
Fix to return a negative error code in the sonypi_compat_init()

 drivers/platform/x86/sony-laptop.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.10.4
author maintainer
#1 lore raw

PATCH 1/2 Fix to return a negative error code in the sonypi_compat_init()

From: Wei Yongjun <[email protected]>

Return -1 in the error handling case instead of 0, as done elsewhere in this function.

---
 drivers/platform/x86/sony-laptop.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/x86/sony-laptop.c +2 -1
index 2ac045f..b162733 100644
@@ -4320,7 +4320,8 @@ static int sony_pic_add(struct acpi_device *device)
 		goto err_free_resources;
 	}
 
-	if (sonypi_compat_init())
+	result = sonypi_compat_init();
+	if (result)
 		goto err_remove_input;
 
 	/* request io port */
Signature · 1 line
1.7.10.4
author maintainer
#2 lore raw

PATCH 2/2 Fix reporting of sony-laptop gfx_switch_status.

In reply to Mattia Dongili

From: Daniel Serpell <[email protected]>

---
 drivers/platform/x86/sony-laptop.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/platform/x86/sony-laptop.c +4 -1
index b162733..3a1b6bf 100644
@@ -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,
Signature · 1 line
1.7.10.4