[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <nycvar.YFH.7.76.2011051109490.18859@cbobk.fhfr.pm>
Date: Thu, 5 Nov 2020 11:09:56 +0100 (CET)
From: Jiri Kosina <jikos@...nel.org>
To: Pablo Ceballos <pceballos@...gle.com>
cc: Jonathan Cameron <jic23@...nel.org>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>,
linux-input@...r.kernel.org, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HID: hid-sensor-hub: Fix issue with devices with no
report ID
On Mon, 2 Nov 2020, Pablo Ceballos wrote:
> Some HID devices don't use a report ID because they only have a single
> report. In those cases, the report ID in struct hid_report will be zero
> and the data for the report will start at the first byte, so don't skip
> over the first byte.
>
> Signed-off-by: Pablo Ceballos <pceballos@...gle.com>
> ---
> drivers/hid/hid-sensor-hub.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
> index 94c7398b5c27..3dd7d3246737 100644
> --- a/drivers/hid/hid-sensor-hub.c
> +++ b/drivers/hid/hid-sensor-hub.c
> @@ -483,7 +483,8 @@ static int sensor_hub_raw_event(struct hid_device *hdev,
> return 1;
>
> ptr = raw_data;
> - ptr++; /* Skip report id */
> + if (report->id)
> + ptr++; /* Skip report id */
>
Applied, thank you.
--
Jiri Kosina
SUSE Labs
Powered by blists - more mailing lists