[PATCH v2 7/7] HID: asus: do not try to initialize the backlight if the enpoint doesn't support it
From: Denis Benato
Date: Sat Feb 28 2026 - 15:09:20 EST
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@xxxxxxxxx>
---
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