Linux Input/HID development
 help / color / mirror / Atom feed
From: Oscar Priego Verdugo <oscar.priegov@gmail.com>
To: Jiri Kosina <jikos@kernel.org>, Benjamin Tissoires <bentiss@kernel.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Oscar Priego Verdugo <oscar.priegov@gmail.com>
Subject: [PATCH] HID: kye: fix inverted Manticore open/close condition
Date: Fri, 11 Sep 2026 04:54:38 -0600	[thread overview]
Message-ID: <20260911105438.1862810-1-oscar.priegov@gmail.com> (raw)

The Manticore workaround is intended to open each HID interface once and
immediately close it, which is required for the keyboard to become fully
functional.

hid_hw_open() returns zero on success, so the current condition is
inverted: successful opens are left outstanding, while hid_hw_close() is
called after a failed open.

Negate the condition so the interface is closed only after a successful
open. This restores the sequence intended by the original workaround while
preserving its best-effort behavior when opening fails.

Fixes: 8a396321e210 ("HID: kye: fix unresponsive keyboard")
Signed-off-by: Oscar Priego Verdugo <oscar.priegov@gmail.com>
---
 drivers/hid/hid-kye.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-kye.c b/drivers/hid/hid-kye.c
index bd96bfa7af70..ed1588e2bfb3 100644
--- a/drivers/hid/hid-kye.c
+++ b/drivers/hid/hid-kye.c
@@ -594,7 +594,7 @@ static int kye_probe(struct hid_device *hdev, const struct hid_device_id *id)
 		 * The manticore keyboard needs to have all the interfaces
 		 * opened at least once to be fully functional.
 		 */
-		if (hid_hw_open(hdev))
+		if (!hid_hw_open(hdev))
 			hid_hw_close(hdev);
 		break;
 	case USB_DEVICE_ID_KYE_EASYPEN_M406:
-- 
2.34.1


                 reply	other threads:[~2026-09-11 10:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260911105438.1862810-1-oscar.priegov@gmail.com \
    --to=oscar.priegov@gmail.com \
    --cc=bentiss@kernel.org \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@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