platform/x86: hp-wmi: Do not shadow error values
authorCarlo Caione <carlo@endlessm.com>
Wed, 19 Apr 2017 20:36:39 +0000 (22:36 +0200)
committerDarren Hart (VMware) <dvhart@infradead.org>
Wed, 19 Apr 2017 20:54:19 +0000 (13:54 -0700)
commitd313876925f3e7a480a02773fd333bcab9202d5e
tree47b647fd140d105067ec50591fef232fbeaaafd6
parentd1c7073bce91fec5af71a8026636a0735f0c867c
platform/x86: hp-wmi: Do not shadow error values

All the helper functions (i.e. hp_wmi_dock_state, hp_wmi_tablet_state,
...) using hp_wmi_perform_query to perform an HP WMI query shadow the
returned value in case of error.

We return -EINVAL only when the HP WMI query returns a positive value
(the specific error code) to not mix this up with the actual value
returned by the helper function.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
drivers/platform/x86/hp-wmi.c