Linux Input/HID development
 help / color / mirror / Atom feed
From: Vicki Pfau <vi@endrift.com>
To: Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <bentiss@kernel.org>,
	linux-input@vger.kernel.org
Cc: Vicki Pfau <vi@endrift.com>
Subject: [PATCH v4 4/6] HID: steam: Don't set feature reports when disconnecting
Date: Fri,  7 Aug 2026 16:23:35 -0700	[thread overview]
Message-ID: <20260807232339.2799205-5-vi@endrift.com> (raw)
In-Reply-To: <20260807232339.2799205-1-vi@endrift.com>

When an input device is closed, we set a feature report to reset lizard
mode and IMU mode. However, if the input device is closed because it was
removed, then we will necessarily error out when sending this, resulting in
logged errors. Since an error here is expected, we should just fail
silently.

Signed-off-by: Vicki Pfau <vi@endrift.com>
---
 drivers/hid/hid-steam.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c
index 8d3ef523682b..d95296b28f92 100644
--- a/drivers/hid/hid-steam.c
+++ b/drivers/hid/hid-steam.c
@@ -490,9 +490,13 @@ static int steam_recv_report_id(struct steam_device *steam,
 	}
 
 	kfree(buf);
-	if (ret < 0)
+	/*
+	 * Don't log if the failure is -ENODEV, as this
+	 * can happen normally on disconnect.
+	 */
+	if (ret < 0 && ret != -ENODEV)
 		hid_err(steam->hdev, "%s: error %d\n", __func__, ret);
-	else
+	else if (ret > 0)
 		hid_dbg(steam->hdev, "Received report %*ph\n", size, data);
 	if (ret < 0)
 		return ret;
@@ -570,7 +574,11 @@ static int steam_send_report_id(struct steam_device *steam,
 	} while (--retries);
 
 	kfree(buf);
-	if (ret < 0)
+	/*
+	 * Don't log if the failure is -ENODEV, as this
+	 * can happen normally on disconnect.
+	 */
+	if (ret < 0 && ret != -ENODEV)
 		hid_err(steam->hdev, "%s: error %d (%*ph)\n", __func__,
 				ret, size, cmd);
 	return ret;
-- 
2.54.0


  parent reply	other threads:[~2026-08-07 23:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07 23:23 [PATCH v4 0/6] HID: steam: Add 2026 Steam Controller support Vicki Pfau
2026-08-07 23:23 ` [PATCH v4 1/6] HID: steam: Refactor registration Vicki Pfau
2026-08-07 23:36   ` sashiko-bot
2026-08-07 23:23 ` [PATCH v4 2/6] HID: steam: Initial 2026 Steam Controller support Vicki Pfau
2026-08-07 23:59   ` sashiko-bot
2026-08-07 23:23 ` [PATCH v4 3/6] HID: steam: Fix wording of connect/disconnect logs Vicki Pfau
2026-08-07 23:23 ` Vicki Pfau [this message]
2026-08-07 23:48   ` [PATCH v4 4/6] HID: steam: Don't set feature reports when disconnecting sashiko-bot
2026-08-07 23:23 ` [PATCH v4 5/6] HID: steam: Clean up locking Vicki Pfau
2026-08-07 23:53   ` sashiko-bot
2026-08-07 23:23 ` [PATCH v4 6/6] HID: steam: Zero out inputs when disabling gamepad mode Vicki Pfau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260807232339.2799205-5-vi@endrift.com \
    --to=vi@endrift.com \
    --cc=bentiss@kernel.org \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox