* [PATCH] HID: ite: Add parse before start
@ 2021-11-04 8:07 Jiasheng Jiang
2021-11-05 18:29 ` Benjamin Tissoires
0 siblings, 1 reply; 2+ messages in thread
From: Jiasheng Jiang @ 2021-11-04 8:07 UTC (permalink / raw)
To: jikos, benjamin.tissoires; +Cc: linux-input, linux-kernel, Jiasheng Jiang
It might be better to add hid_parse() before
wacom_parse_and_register() to ask for the report descriptor.
Fixes: 3c785a0 ("HID: ite: Replace ABS_MISC 120/121 events with touchpad on/off keypresses")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
drivers/hid/hid-ite.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/hid/hid-ite.c b/drivers/hid/hid-ite.c
index 14fc068..3c56f75 100644
--- a/drivers/hid/hid-ite.c
+++ b/drivers/hid/hid-ite.c
@@ -100,6 +100,10 @@ static int ite_probe(struct hid_device *hdev, const struct hid_device_id *id)
if (ret)
return ret;
+ ret = hid_parse(hdev);
+ if (ret)
+ return ret;
+
return hid_hw_start(hdev, HID_CONNECT_DEFAULT);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] HID: ite: Add parse before start
2021-11-04 8:07 [PATCH] HID: ite: Add parse before start Jiasheng Jiang
@ 2021-11-05 18:29 ` Benjamin Tissoires
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Tissoires @ 2021-11-05 18:29 UTC (permalink / raw)
To: Jiasheng Jiang; +Cc: Jiri Kosina, open list:HID CORE LAYER, lkml
Hi Jiasheng,
On Thu, Nov 4, 2021 at 9:08 AM Jiasheng Jiang <jiasheng@iscas.ac.cn> wrote:
>
> It might be better to add hid_parse() before
> wacom_parse_and_register() to ask for the report descriptor.
seems like a copy/paste error when working on 2 different drivers.
>
> Fixes: 3c785a0 ("HID: ite: Replace ABS_MISC 120/121 events with touchpad on/off keypresses")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
> drivers/hid/hid-ite.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/hid/hid-ite.c b/drivers/hid/hid-ite.c
> index 14fc068..3c56f75 100644
> --- a/drivers/hid/hid-ite.c
> +++ b/drivers/hid/hid-ite.c
> @@ -100,6 +100,10 @@ static int ite_probe(struct hid_device *hdev, const struct hid_device_id *id)
> if (ret)
> return ret;
>
> + ret = hid_parse(hdev);
hid_parse() is an inline definition of hid_open_report() which is
called just above.
So here you are asking to call the same code twice, which is suboptimal.
Cheers,
Benjamin
> + if (ret)
> + return ret;
> +
> return hid_hw_start(hdev, HID_CONNECT_DEFAULT);
> }
>
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-05 18:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-04 8:07 [PATCH] HID: ite: Add parse before start Jiasheng Jiang
2021-11-05 18:29 ` Benjamin Tissoires
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).