lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20231210133906.3050a145@jic23-huawei>
Date:   Sun, 10 Dec 2023 13:39:06 +0000
From:   Jonathan Cameron <jic23@...nel.org>
To:     Anshul Dalal <anshulusr@...il.com>
Cc:     linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
        devicetree@...r.kernel.org, Conor Dooley <conor+dt@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        linux-kernel-mentees@...ts.linuxfoundation.org
Subject: Re: [PATCH v3 2/2] iio: light: driver for Lite-On ltr390

On Fri,  8 Dec 2023 15:52:10 +0530
Anshul Dalal <anshulusr@...il.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@...il.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);
> +}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ