Skip to content

Commit

Permalink
platform/x86: hp-wmi: Fix error value for hp_wmi_tablet_state
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Carlo Caione authored and dvhart committed Apr 14, 2017
1 parent 05aa43c commit c7dfc2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/platform/x86/hp-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c7dfc2f

Please sign in to comment.