Re: [PATCH 2/3] iio: light: opt4001: refactor driver to prepare to support more devices

From: Joshua Crofts

Date: Fri Oct 23 2026 - 05:11:03 EST


On Fri, 23 Oct 2026 09:48:14 +0200
Jesper X Nilsson <jesper.x.nilsson@xxxxxxxx> wrote:

> Prepare opt4001 driver to be able to support OPT4041. Extend struct
> opt4001_chip_info with fields channels and device_id because OPT4041 has
> two channels and another device id.
>
> Datasheet: https://www.ti.com/lit/gpn/opt4041
> Assisted-by: LLM

This tag has been deprecated.

> Signed-off-by: Jesper X Nilsson <jesper.x.nilsson@xxxxxxxx>

...

> @@ -388,19 +411,19 @@ static int opt4001_probe(struct i2c_client *client)
> return dev_err_probe(&client->dev, ret,
> "failed to reinit regmap cache\n");
>
> + chip->chip_info = i2c_get_match_data(client);

+ null check and return -ENODATA on failure.

--
Kind regards,
Joshua Crofts