Commit c5502a4b authored by Carlo Caione's avatar Carlo Caione Committed by Thadeu Lima de Souza Cascardo

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

BugLink: http://bugs.launchpad.net/bugs/1732698

commit c7dfc2fa upstream.

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: default avatarCarlo Caione <carlo@endlessm.com>
Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
Cc: Philip Müller <philm@manjaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
parent 5be7764b
...@@ -291,7 +291,7 @@ static int hp_wmi_tablet_state(void) ...@@ -291,7 +291,7 @@ static int hp_wmi_tablet_state(void)
int ret = hp_wmi_perform_query(HPWMI_HARDWARE_QUERY, 0, &state, int ret = hp_wmi_perform_query(HPWMI_HARDWARE_QUERY, 0, &state,
sizeof(state), sizeof(state)); sizeof(state), sizeof(state));
if (ret) if (ret)
return ret; return -EINVAL;
return (state & 0x4) ? 1 : 0; return (state & 0x4) ? 1 : 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment