From patchwork Mon Aug 12 16:21:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 11090115 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 56F3914D5 for ; Mon, 12 Aug 2019 16:21:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47F5326E47 for ; Mon, 12 Aug 2019 16:21:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C6EC28518; Mon, 12 Aug 2019 16:21:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFC7A26E47 for ; Mon, 12 Aug 2019 16:21:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726263AbfHLQVM (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 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-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;