Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3978920ybl; Mon, 12 Aug 2019 09:23:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvN9NYrKNArq40TqoMBTAgwsz1nxzxqbfVOKVkDIDfXdK7QfWdp0KrzXTD5/W6b4cCCWwB X-Received: by 2002:aa7:8e10:: with SMTP id c16mr35519644pfr.124.1565627007075; Mon, 12 Aug 2019 09:23:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565627007; cv=none; d=google.com; s=arc-20160816; b=viW6zhTwdp9r4j3zDB+yhYB+bPHnH9uGzfIU7RAZ35/siMvx/jvOpZmC2UjaV2Qv70 TlHOt/xQt6kb2KAIEV97rCCayPb3TJNCyXjsC3HCtJZvM7b9LRx112YpahlMaUnY/FU6 WuVWWdbCLVfB64A3CycO5QtdbHcN6KCfTwcfzEX7GxdGq91gJYogQRjks24g9J3q93XY v7fvkkJZER56drkbXZHji8oRq6kj13r3vY/VcgoA5gQokzoGnSlwjvR29XKKknKtRlxh 0dkJ2QpE9Jvd/E+VPvseAFRb2uzwBK1eCugYkqj1M3VjRd96m1tevvvkhfQUIZsVHB0q AC2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=T5fsOl26kKtT7VJxYPzkEcbzVEAnjclLlFQbYrvV0QU=; b=EPddL4CK/ar92KdAjg3cDM+6Da/XNfdBaWSkqokHskzr0RlavVib825rBbmPl46rNA AdQvw0mMsxfFl1/uOsExTUGx6D5mgJO+t5n7Zc2kP+FKE7vHNmtIGcVj5poVhCbyiykh ACUq+/LIK/i3IP2MtAPOjGCNz2OX9FWpMHIFYUxrxpq2rm0woKdZ728fVCpEpjJyfl79 BGz4/hKPSfNjyNn5pQydApinZX0zbdIG0S9VMzPvqDFQ5mzI01c2oWuOSk9cqlAqGXfd Y/4LLSXZ2cYk4dOc/CGUvljfx7Dpd2xEReYqzgFQ2eWiMuhPeevQHeFgZXRUJVC4T957 9KdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i14si9373998pfq.287.2019.08.12.09.23.10; Mon, 12 Aug 2019 09:23:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726605AbfHLQVM (ORCPT + 99 others); Mon, 12 Aug 2019 12:21:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35082 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725887AbfHLQVM (ORCPT ); Mon, 12 Aug 2019 12:21:12 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EC7F1C008601; Mon, 12 Aug 2019 16:21:11 +0000 (UTC) Received: from plouf.redhat.com (ovpn-117-165.ams2.redhat.com [10.36.117.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04A68100195F; Mon, 12 Aug 2019 16:21:07 +0000 (UTC) From: Benjamin Tissoires To: David Rheinsberg , Jiri Kosina Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Tissoires Subject: [PATCH] HID: uhid: actually use the err number from userspace Date: Mon, 12 Aug 2019 18:21:05 +0200 Message-Id: <20190812162105.13428-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 12 Aug 2019 16:21:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This can help debugging the situation Signed-off-by: Benjamin Tissoires --- Hi, not entirely sure if we can use this in a such simple way. However, this is useful to mimic device behaviour from userspace. Cheers, Benjamin drivers/hid/uhid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index fa0cc0899827..2fa32e7fc733 100644 --- a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c @@ -284,7 +284,7 @@ static int uhid_hid_set_report(struct hid_device *hid, unsigned char rnum, goto unlock; if (uhid->report_buf.u.set_report_reply.err) - ret = -EIO; + ret = -uhid->report_buf.u.set_report_reply.err; else ret = count; -- 2.19.2