提交 c7dfc2fa 编写于 作者: C Carlo Caione 提交者: Darren Hart (VMware)

platform/x86: hp-wmi: Fix error value for hp_wmi_tablet_state

hp_wmi_tablet_state() fails to return the correct error code when
hp_wmi_perform_query() returns the HP WMI query specific error code
that is a positive value.
Signed-off-by: NCarlo Caione <carlo@endlessm.com>
Signed-off-by: NDarren Hart (VMware) <dvhart@infradead.org>
上级 05aa43cc
......@@ -290,7 +290,7 @@ static int hp_wmi_tablet_state(void)
int ret = hp_wmi_perform_query(HPWMI_HARDWARE_QUERY, 0, &state,
sizeof(state), sizeof(state));
if (ret)
return ret;
return -EINVAL;
return (state & 0x4) ? 1 : 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册