Re: [PATCH 2/3] iio: adc: ti-ads1015: use local device pointer in probe

From: Andy Shevchenko

Date: Sat Jul 18 2026 - 04:37:26 EST


On Sat, Jul 18, 2026 at 01:20:15PM +0530, Archit Anant wrote:
> Introduce a local device pointer 'dev' in ads1015_probe to
> avoid accessing &client->dev repeatedly.

...

> static int ads1015_probe(struct i2c_client *client)

> struct ads1015_data *data;
> int ret;
> int i;
> + struct device *dev = &client->dev;

Preserve reversed xmas tree order.

...

> chip = i2c_get_match_data(client);
> if (!chip)
> - return dev_err_probe(&client->dev, -EINVAL, "Unknown chip\n");
> + return dev_err_probe(dev, -EINVAL, "Unknown chip\n");

Side note: At some point we probably want to unify the error code for missing
driver data to be -ENODATA.

--
With Best Regards,
Andy Shevchenko