[PATCH v8 02/10] HID: asus: use same report_id in response

Antheas Kapenekakis posted 10 patches 3 months, 1 week ago
There is a newer version of this series
[PATCH v8 02/10] HID: asus: use same report_id in response
Posted by Antheas Kapenekakis 3 months, 1 week ago
Currently, asus_kbd_get_functions prods the device using feature
report report_id, but then is hardcoded to check the response through
FEATURE_KBD_REPORT_ID. This only works if report_id is that value
(currently true). So, use report_id in the response as well to
maintain functionality if that value changes in the future.

Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
---
 drivers/hid/hid-asus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 7ea1037c3979..4676b7f20caf 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -422,7 +422,7 @@ static int asus_kbd_get_functions(struct hid_device *hdev,
 	if (!readbuf)
 		return -ENOMEM;
 
-	ret = hid_hw_raw_request(hdev, FEATURE_KBD_REPORT_ID, readbuf,
+	ret = hid_hw_raw_request(hdev, report_id, readbuf,
 				 FEATURE_KBD_REPORT_SIZE, HID_FEATURE_REPORT,
 				 HID_REQ_GET_REPORT);
 	if (ret < 0) {
-- 
2.51.2
Re: [PATCH v8 02/10] HID: asus: use same report_id in response
Posted by Denis Benato 2 months, 3 weeks ago
On 11/1/25 11:47, Antheas Kapenekakis wrote:
> Currently, asus_kbd_get_functions prods the device using feature
> report report_id, but then is hardcoded to check the response through
> FEATURE_KBD_REPORT_ID. This only works if report_id is that value
> (currently true). So, use report_id in the response as well to
> maintain functionality if that value changes in the future.
>
> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
> ---
>  drivers/hid/hid-asus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> index 7ea1037c3979..4676b7f20caf 100644
> --- a/drivers/hid/hid-asus.c
> +++ b/drivers/hid/hid-asus.c
> @@ -422,7 +422,7 @@ static int asus_kbd_get_functions(struct hid_device *hdev,
>  	if (!readbuf)
>  		return -ENOMEM;
>  
> -	ret = hid_hw_raw_request(hdev, FEATURE_KBD_REPORT_ID, readbuf,
> +	ret = hid_hw_raw_request(hdev, report_id, readbuf,
>  				 FEATURE_KBD_REPORT_SIZE, HID_FEATURE_REPORT,
>  				 HID_REQ_GET_REPORT);
>  	if (ret < 0) {
Why is this patch even here? This should have been sent as a fix on its own
months ago.

Reviewed-by: Denis Benato <benato.denis96@gmail.com>