提交 a1071a5a 编写于 作者: M Mattia Dongili 提交者: Matthew Garrett

sony-laptop: correct find_snc_handle failure checks

Since bab7084c, find_snc_handle
returns -EINVAL, not -1.
Signed-off-by: NMattia Dongili <malattia@linux.it>
Signed-off-by: NMatthew Garrett <mjg@redhat.com>
上级 56f4a9f7
...@@ -2555,19 +2555,19 @@ static void sony_nc_backlight_setup(void) ...@@ -2555,19 +2555,19 @@ static void sony_nc_backlight_setup(void)
const struct backlight_ops *ops = NULL; const struct backlight_ops *ops = NULL;
struct backlight_properties props; struct backlight_properties props;
if (sony_find_snc_handle(0x12f) != -1) { if (sony_find_snc_handle(0x12f) >= 0) {
ops = &sony_backlight_ng_ops; ops = &sony_backlight_ng_ops;
sony_bl_props.cmd_base = 0x0100; sony_bl_props.cmd_base = 0x0100;
sony_nc_backlight_ng_read_limits(0x12f, &sony_bl_props); sony_nc_backlight_ng_read_limits(0x12f, &sony_bl_props);
max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset;
} else if (sony_find_snc_handle(0x137) != -1) { } else if (sony_find_snc_handle(0x137) >= 0) {
ops = &sony_backlight_ng_ops; ops = &sony_backlight_ng_ops;
sony_bl_props.cmd_base = 0x0100; sony_bl_props.cmd_base = 0x0100;
sony_nc_backlight_ng_read_limits(0x137, &sony_bl_props); sony_nc_backlight_ng_read_limits(0x137, &sony_bl_props);
max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset; max_brightness = sony_bl_props.maxlvl - sony_bl_props.offset;
} else if (sony_find_snc_handle(0x143) != -1) { } else if (sony_find_snc_handle(0x143) >= 0) {
ops = &sony_backlight_ng_ops; ops = &sony_backlight_ng_ops;
sony_bl_props.cmd_base = 0x3000; sony_bl_props.cmd_base = 0x3000;
sony_nc_backlight_ng_read_limits(0x143, &sony_bl_props); sony_nc_backlight_ng_read_limits(0x143, &sony_bl_props);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册