platform/x86: hp-wmi: Fix error value for hp_wmi_tablet_state
authorCarlo Caione <carlo@endlessm.com>
Sun, 9 Apr 2017 13:56:07 +0000 (15:56 +0200)
committerDarren Hart (VMware) <dvhart@infradead.org>
Fri, 14 Apr 2017 15:26:34 +0000 (08:26 -0700)
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>
drivers/platform/x86/hp-wmi.c

index 7abf92d0ba81ce9f33a2b2b48f30a17fd809da0f..9db502c42b5c87acda3bf8e3b9bb6c0e9254b9ce 100644 (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;
 }