From: Carlo Caione Date: Sun, 9 Apr 2017 13:56:07 +0000 (+0200) Subject: platform/x86: hp-wmi: Fix error value for hp_wmi_tablet_state X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c7dfc2facbd69dad89b75e13c608da709668dcd0;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Darren Hart (VMware) --- diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 7abf92d0ba81..9db502c42b5c 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -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; }