public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
From: Denis Benato <denis.benato@linux.dev>
To: linux-kernel@vger.kernel.org
Cc: linux-input@vger.kernel.org,
	"Benjamin Tissoires" <bentiss@kernel.org>,
	"Jiri Kosina" <jikos@kernel.org>,
	"Luke D . Jones" <luke@ljones.dev>,
	"Mateusz Schyboll" <dragonn@op.pl>,
	"Denis Benato" <benato.denis96@gmail.com>,
	"Denis Benato" <denis.benato@linux.dev>
Subject: [PATCH v2 7/7] HID: asus: do not try to initialize the backlight if the enpoint doesn't support it
Date: Sat, 28 Feb 2026 20:10:10 +0100	[thread overview]
Message-ID: <20260228191010.3830758-8-denis.benato@linux.dev> (raw)
In-Reply-To: <20260228191010.3830758-1-denis.benato@linux.dev>

Avoid possibly printing a warning about the inability to initialize the
backlight if the hid endpoint doesn't support it.

Also fix and move an incorrect check in asus_kbd_register_leds(): that
same check is now used as a precondition to call that function.

Fixes: 0919db9f3583 ("HID: asus: always fully initialize devices")
Signed-off-by: Denis Benato <denis.benato@linux.dev>
---
 drivers/hid/hid-asus.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 5780e70aebd5..9291f23c10b7 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -737,10 +737,6 @@ static int asus_kbd_register_leds(struct hid_device *hdev)
 	unsigned char kbd_func;
 	int ret;
 
-	/* Laptops keyboard backlight is always at 0x5a */
-	if (asus_has_report_id(hdev, FEATURE_KBD_REPORT_ID))
-		return -ENODEV;
-
 	/* Get keyboard functions */
 	ret = asus_kbd_get_functions(hdev, &kbd_func, FEATURE_KBD_REPORT_ID);
 	if (ret < 0)
@@ -1306,8 +1302,10 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
 		}
 	}
 
+	/* Laptops keyboard backlight is always at 0x5a */
 	if (is_vendor && (drvdata->quirks & QUIRK_USE_KBD_BACKLIGHT) &&
-	    asus_kbd_register_leds(hdev))
+	    (asus_has_report_id(hdev, FEATURE_KBD_REPORT_ID)) &&
+		(asus_kbd_register_leds(hdev)))
 		hid_warn(hdev, "Failed to initialize backlight.\n");
 
 	/*
-- 
2.53.0


  parent reply	other threads:[~2026-02-28 19:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-28 19:10 [PATCH v2 0/7] HID: asus: increase robustness of the driver Denis Benato
2026-02-28 19:10 ` [PATCH v2 1/7] HID: asus: fix code style of comments and brackets Denis Benato
2026-02-28 19:10 ` [PATCH v2 2/7] HID: asus: add xg mobile 2022 external hardware support Denis Benato
2026-02-28 19:10 ` [PATCH v2 3/7] HID: asus: fix compiler warning about unused variables Denis Benato
2026-02-28 19:10 ` [PATCH v2 4/7] HID: asus: make asus_resume adhere to linux kernel coding standards Denis Benato
2026-02-28 19:10 ` [PATCH v2 5/7] HID: asus: simplify and improve asus_kbd_set_report() Denis Benato
2026-02-28 19:10 ` [PATCH v2 6/7] HID: asus: do not abort probe when not necessary Denis Benato
2026-02-28 19:10 ` Denis Benato [this message]
2026-03-10 17:04 ` [PATCH v2 0/7] HID: asus: increase robustness of the driver Jiri Kosina

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=20260228191010.3830758-8-denis.benato@linux.dev \
    --to=denis.benato@linux.dev \
    --cc=benato.denis96@gmail.com \
    --cc=bentiss@kernel.org \
    --cc=dragonn@op.pl \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luke@ljones.dev \
    /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