From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F1C5C31E40 for ; Mon, 12 Aug 2019 16:21:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5BB9120684 for ; Mon, 12 Aug 2019 16:21:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726647AbfHLQVM (ORCPT ); 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