OSDN Git Service

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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Nov 2017 16:13:11 +0000 (17:13 +0100)
commit44e0e2b47af248766bfe9395e50a3729fe81b018
treeca9db0f1c8e13007c478fdc33d03bf55aeefc5f9
parentce93b664540d84b87fbbf21b5e85fbba554d83ed
platform/x86: hp-wmi: Do not shadow error values

commit d313876925f3e7a480a02773fd333bcab9202d5e upstream.

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>
Cc: Philip Müller <philm@manjaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/platform/x86/hp-wmi.c