diff options
author | Mattia Dongili <malattia@linux.it> | 2012-06-13 17:36:02 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2012-06-26 14:43:39 -0400 |
commit | a1071a5abf1f4d4a7f8324e21b8b32b1342013c7 (patch) | |
tree | bc5beba6691344c734177ba942c208175ecd43c2 /drivers/platform | |
parent | 56f4a9f76d8ce7c7cef92905c909aad0c7e5c9db (diff) |
sony-laptop: correct find_snc_handle failure checks
Since bab7084c745bf4d75b760728387f375fd34dc683, find_snc_handle
returns -EINVAL, not -1.
Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/sony-laptop.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index b9499b65c1cd..d456ff0c73b7 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c | |||
@@ -2555,19 +2555,19 @@ static void sony_nc_backlight_setup(void) | |||
2555 | const struct backlight_ops *ops = NULL; | 2555 | const struct backlight_ops *ops = NULL; |
2556 | struct backlight_properties props; | 2556 | struct backlight_properties props; |
2557 | 2557 | ||
2558 | if (sony_find_snc_handle(0x12f) != -1) { | 2558 | if (sony_find_snc_handle(0x12f) >= 0) { |
2559 | ops = &sony_backlight_ng_ops; | 2559 | ops = &sony_backlight_ng_ops; |
2560 | sony_bl_props.cmd_base = 0x0100; | 2560 | sony_bl_props.cmd_base = 0x0100; |
2561 | sony_nc_backlight_ng_read_limits(0x12f, &sony_bl_props); | 2561 | sony_nc_backlight_ng_read_limits(0x12f, &sony_bl_props); |
2562 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; | 2562 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; |
2563 | 2563 | ||
2564 | } else if (sony_find_snc_handle(0x137) != -1) { | 2564 | } else if (sony_find_snc_handle(0x137) >= 0) { |
2565 | ops = &sony_backlight_ng_ops; | 2565 | ops = &sony_backlight_ng_ops; |
2566 | sony_bl_props.cmd_base = 0x0100; | 2566 | sony_bl_props.cmd_base = 0x0100; |
2567 | sony_nc_backlight_ng_read_limits(0x137, &sony_bl_props); | 2567 | sony_nc_backlight_ng_read_limits(0x137, &sony_bl_props); |
2568 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; | 2568 | max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; |
2569 | 2569 | ||
2570 | } else if (sony_find_snc_handle(0x143) != -1) { | 2570 | } else if (sony_find_snc_handle(0x143) >= 0) { |
2571 | ops = &sony_backlight_ng_ops; | 2571 | ops = &sony_backlight_ng_ops; |
2572 | sony_bl_props.cmd_base = 0x3000; | 2572 | sony_bl_props.cmd_base = 0x3000; |
2573 | sony_nc_backlight_ng_read_limits(0x143, &sony_bl_props); | 2573 | sony_nc_backlight_ng_read_limits(0x143, &sony_bl_props); |