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: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
This commit is contained in:
Carlo Caione 2017-04-09 15:56:07 +02:00 committed by Darren Hart (VMware)
parent 05aa43cce0
commit c7dfc2facb

View File

@ -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;
}