Re: [PATCH v5 2/8] iio: light: opt3001: use local struct device and i2c_client variables

From: Andy Shevchenko

Date: Thu Jun 04 2026 - 02:44:53 EST


On Wed, Jun 03, 2026 at 07:12:53PM +0200, Joshua Crofts wrote:
> Switch the driver to use local variables for struct device and struct
> i2c_client and remove struct device member from struct opt3001, as the
> former can be derived from struct client.
>
> While at it, ensure that parentheses alignment is correct in functions
> that were changed in this patch.
>
> No functional change.

...

> static int opt3001_read_id(struct opt3001 *opt)

In this function...

> if (ret < 0) {
> - dev_err(opt->dev, "failed to read register %02x\n",
> - OPT3001_MANUFACTURER_ID);
> + dev_err(dev, "failed to read register %02x\n",
> + OPT3001_MANUFACTURER_ID);
> return ret;

...this and similar changes should be dropped from this patch as you anyway
convert to dev_err_probe() later on in the same series. So, please reduce
the churn.

> }

--
With Best Regards,
Andy Shevchenko