public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Anshul Dalal <anshulusr@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org, Conor Dooley <conor+dt@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [PATCH v3 2/2] iio: light: driver for Lite-On ltr390
Date: Sun, 10 Dec 2023 13:39:06 +0000	[thread overview]
Message-ID: <20231210133906.3050a145@jic23-huawei> (raw)
In-Reply-To: <20231208102211.413019-2-anshulusr@gmail.com>

On Fri,  8 Dec 2023 15:52:10 +0530
Anshul Dalal <anshulusr@gmail.com> wrote:

> Implements driver for the Ambient/UV Light sensor LTR390.
> The driver exposes two ways of getting sensor readings:
>   1. Raw UV Counts directly from the sensor
>   2. The computed UV Index value with a percision of 2 decimal places
> 
> [NOTE] Ambient light sensing has not been implemented yet.
> 
> Driver tested on RPi Zero 2W
> 
> Datasheet: https://optoelectronics.liteon.com/upload/download/DS86-2015-0004/LTR-390UV_Final_%20DS_V1%201.pdf
> Signed-off-by: Anshul Dalal <anshulusr@gmail.com>

I fixed up the case where you use dev_err_probe() in a path called from
places other than the probe() callback.

Applied to the togreg branch of iio.git and initially pushed out as testing for 0-day
to take a look and see if it can find things we missed

Thanks,

Jonathan


> +
> +static int ltr390_register_read(struct ltr390_data *data, u8 register_address)
> +{
> +	struct device *dev = &data->client->dev;
> +	int ret;
> +	u8 recieve_buffer[3];
> +
> +	guard(mutex)(&data->lock);
> +
> +	ret = regmap_bulk_read(data->regmap, register_address, recieve_buffer,
> +			       sizeof(recieve_buffer));
> +	if (ret)
> +		return dev_err_probe(dev, ret,
dev_err_probe() is only intended for use in probe() and functions that are
only called from probe()
> +				     "failed to read measurement data");
> +
> +	return get_unaligned_le24(recieve_buffer);
> +}


      reply	other threads:[~2023-12-10 13:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08 10:22 [PATCH v3 1/2] dt-bindings: iio: light: add ltr390 Anshul Dalal
2023-12-08 10:22 ` [PATCH v3 2/2] iio: light: driver for Lite-On ltr390 Anshul Dalal
2023-12-10 13:39   ` 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=20231210133906.3050a145@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=anshulusr@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /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