[PATCH 3/3] sony-laptop: report failures on setting LCD brightness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Check if we were successful in setting the requested brightness and
report failure in that case.

Signed-off-by: Mattia Dongili <malattia@xxxxxxxx>
---
 drivers/platform/x86/sony-laptop.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index c8d755a..2fe7ddd 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -961,9 +961,10 @@ static int sony_nc_update_status_ng(struct backlight_device *bd)
 	int *handle = (int *)bl_get_data(bd);
 
 	value = bd->props.brightness;
-	sony_call_snc_handle(*handle, 0x0100 | (value << 16), &result);
+	if (sony_call_snc_handle(*handle, 0x0100 | (value << 16), &result))
+		return -EIO;
 
-	return sony_nc_get_brightness_ng(bd);
+	return value;
 }
 
 static const struct backlight_ops sony_backlight_ops = {
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux