aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMattia Dongili <malattia@linux.it>2011-04-05 10:38:36 -0400
committerMatthew Garrett <mjg@redhat.com>2011-05-09 10:26:44 -0400
commit6192fa7109fb33591fa1078c8c1981e39da02d2d (patch)
treed7fb75fcf18338d55316170f05e59f1980e5b134 /drivers
parent9fbdaeb4f4dd14a0caa9fc35c496d5440c251a3a (diff)
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 <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/platform/x86/sony-laptop.c5
1 files changed, 3 insertions, 2 deletions
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)
966 int *handle = (int *)bl_get_data(bd); 966 int *handle = (int *)bl_get_data(bd);
967 967
968 value = bd->props.brightness; 968 value = bd->props.brightness;
969 sony_call_snc_handle(*handle, 0x0100 | (value << 16), &result); 969 if (sony_call_snc_handle(*handle, 0x0100 | (value << 16), &result))
970 return -EIO;
970 971
971 return sony_nc_get_brightness_ng(bd); 972 return value;
972} 973}
973 974
974static const struct backlight_ops sony_backlight_ops = { 975static const struct backlight_ops sony_backlight_ops = {