Re: [PATCH RESEND v5 6/6] iio: accel: mma8452: Reuse existing dev pointer in mma8452_probe()

From: Andy Shevchenko

Date: Wed Aug 19 2026 - 09:56:35 EST


On Wed, Aug 19, 2026 at 10:15:33AM +0200, Esben Haabendal wrote:
> In commit 32a5c04d4575 ("iio: accel: mma8452: Use dev_err_probe()") the
> struct device * pointer was assigned to local variable dev, so we can just
> as well reuse that throughout the function for sligthly more readable code.

...

> data->chip_info = i2c_get_match_data(client);
> if (!data->chip_info)
> - return dev_err_probe(&client->dev, -ENODEV,
> - "unknown device model\n");
> + return dev_err_probe(dev, -ENODEV, "unknown device model\n");

I would also move to -ENODATA. This can be done in a separate patch with might
be unified with the 'dev' use.

--
With Best Regards,
Andy Shevchenko