Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752516AbdDIN43 (ORCPT ); Sun, 9 Apr 2017 09:56:29 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35061 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752406AbdDIN4R (ORCPT ); Sun, 9 Apr 2017 09:56:17 -0400 From: Carlo Caione To: dvhart@infradead.org, andy@infradead.org, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux@endlessm.com Cc: Carlo Caione Subject: [PATCH 1/2] hp-wmi: Fix error value for hp_wmi_tablet_state Date: Sun, 9 Apr 2017 15:56:07 +0200 Message-Id: <20170409135608.15621-2-carlo@caione.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170409135608.15621-1-carlo@caione.org> References: <20170409135608.15621-1-carlo@caione.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 776 Lines: 26 From: Carlo Caione 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 --- drivers/platform/x86/hp-wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 96ffda4..13ba65c 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; } -- 2.9.3