Linux Input/HID development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: jikos@kernel.org, lars@metafoo.de, Basavaraj.Natikar@amd.com,
	linux-input@vger.kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: hid-sensor-als: Return 0 for HID_USAGE_SENSOR_TIME_TIMESTAMP
Date: Sun, 4 Feb 2024 14:03:26 +0000	[thread overview]
Message-ID: <20240204140326.09a91224@jic23-huawei> (raw)
In-Reply-To: <20240204125617.2635574-1-srinivas.pandruvada@linux.intel.com>

On Sun,  4 Feb 2024 04:56:17 -0800
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> wrote:

> When als_capture_sample() is called with usage ID
> HID_USAGE_SENSOR_TIME_TIMESTAMP, return 0. The HID sensor core ignores
> the return value for capture_sample() callback, so return value doesn't
> make difference. But correct the return value to return success instead
> of -EINVAL.
> 
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Applied and marked for stable.

Whilst this is the minimal fix (and so the right one!) it would be good
to change this as a follow up to just use direct returns as then this
sort of bug won't get reintroduced and the code will be a bit simpler.

Jonathan

> ---
> As part of review comments for series "Add support of color temperature
> and chromaticity". This is separate from the series as this is
> unrelated.
> 
>  drivers/iio/light/hid-sensor-als.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
> index 5cd27f04b45e..b6c4bef2a7bb 100644
> --- a/drivers/iio/light/hid-sensor-als.c
> +++ b/drivers/iio/light/hid-sensor-als.c
> @@ -226,6 +226,7 @@ static int als_capture_sample(struct hid_sensor_hub_device *hsdev,
>  	case HID_USAGE_SENSOR_TIME_TIMESTAMP:
>  		als_state->timestamp = hid_sensor_convert_timestamp(&als_state->common_attributes,
>  								    *(s64 *)raw_data);
> +		ret = 0;
>  		break;
>  	default:
>  		break;


      reply	other threads:[~2024-02-04 14:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-04 12:56 [PATCH] iio: hid-sensor-als: Return 0 for HID_USAGE_SENSOR_TIME_TIMESTAMP Srinivas Pandruvada
2024-02-04 14:03 ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240204140326.09a91224@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Basavaraj.Natikar@amd.com \
    --cc=jikos@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox