Skip to contentSkip to conversation

sony-laptop: return negative on failure in

PATCH Applied Dan Carpenter 2 participants 2 messages Feb 26, 2011 – Feb 27, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/4 sony-laptop: return negative on failure in

There were two places in sony_nc_add() where we returned zero on failure instead of a negative error code.

drivers/platform/x86/sony-laptop.c +4 -2
index a7b9c72..d0d0522 100644
@@ -1593,9 +1593,11 @@ static int sony_nc_add(struct acpi_device *device)
 	if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "SN00",
 					 &handle))) {
 		dprintk("Doing SNC setup\n");
-		if (sony_nc_handles_setup(sony_pf_device))
+		result = sony_nc_handles_setup(sony_pf_device);
+		if (result)
 			goto outpresent;
-		if (sony_nc_kbd_backlight_setup(sony_pf_device))
+		result = sony_nc_kbd_backlight_setup(sony_pf_device);
+		if (result)
 			goto outsnc;
 		sony_nc_function_setup(device);
 		sony_nc_rfkill_setup(device);
maintainer Acked-by on v1 2/4
#1 lore raw
Quoted 4 lines · Dan Carpenter

There were two places in sony_nc_add() where we returned zero on failure instead of a negative error code.

Quoted 18 lines
drivers/platform/x86/sony-laptop.c +4 -2
index a7b9c72..d0d0522 100644
@@ -1593,9 +1593,11 @@ static int sony_nc_add(struct acpi_device *device)
 	if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "SN00",
 					 &handle))) {
 		dprintk("Doing SNC setup\n");
-		if (sony_nc_handles_setup(sony_pf_device))
+		result = sony_nc_handles_setup(sony_pf_device);
+		if (result)
 			goto outpresent;
-		if (sony_nc_kbd_backlight_setup(sony_pf_device))
+		result = sony_nc_kbd_backlight_setup(sony_pf_device);
+		if (result)
 			goto outsnc;
 		sony_nc_function_setup(device);
 		sony_nc_rfkill_setup(device);
Signature · 2 lines
mattia
:wq!