diff mbox series

[02/11] HID: asus: cleanup keyboard backlight check

Message ID 20250319191320.10092-3-lkml@antheas.dev (mailing list archive)
State New
Delegated to: Jiri Kosina
Headers show
Series HID: asus: hid-asus and asus-wmi backlight unification, Z13 QOL improvements | expand

Commit Message

Antheas Kapenekakis March 19, 2025, 7:13 p.m. UTC
Currently, asus_kbd_get_functions does a set_report
to query for the keyboard backlight status using a varying
report id. However, it then does get_report with the fixed
id 0x5a. The ids of get_report and set_report should always
match. Therefore, remove the calling argument and force 0x5a.

Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
---
 drivers/hid/hid-asus.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index aa4a481dc4f27..bcc317057b465 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -427,10 +427,9 @@  static int asus_kbd_init(struct hid_device *hdev)
 }
 
 static int asus_kbd_get_functions(struct hid_device *hdev,
-				  unsigned char *kbd_func,
-				  u8 report_id)
+				  unsigned char *kbd_func)
 {
-	const u8 buf[] = { report_id, 0x05, 0x20, 0x31, 0x00, 0x08 };
+	const u8 buf[] = { FEATURE_KBD_REPORT_ID, 0x05, 0x20, 0x31, 0x00, 0x08 };
 	u8 *readbuf;
 	int ret;
 
@@ -572,7 +571,7 @@  static int asus_kbd_register_leds(struct hid_device *hdev)
 		return ret;
 
 	/* Get keyboard functions */
-	ret = asus_kbd_get_functions(hdev, &kbd_func, FEATURE_KBD_REPORT_ID);
+	ret = asus_kbd_get_functions(hdev, &kbd_func);
 	if (ret < 0)
 		return ret;