From: Mattia Dongili Date: Tue, 5 Apr 2011 14:38:36 +0000 (+0900) Subject: sony-laptop: report failures on setting LCD brightness X-Git-Tag: firefly_0821_release~7613^2~1484^2~2 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=6192fa7109fb33591fa1078c8c1981e39da02d2d;p=firefly-linux-kernel-4.4.55.git sony-laptop: report failures on setting LCD brightness Check if we were successful in setting the requested brightness and report failure in that case. Signed-off-by: Mattia Dongili Signed-off-by: Matthew Garrett --- diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 8f709aec4da0..9d80ae4e6be6 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -966,9 +966,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 = {