Re: [PATCH 2/2] iio: light: cm3323: use dev_err_probe() in probe path
From: Andy Shevchenko
Date: Thu Apr 02 2026 - 12:20:09 EST
On Thu, Apr 02, 2026 at 05:17:30PM +0200, Aldo Conte wrote:
> Replace dev_err() calls with dev_err_probe() in cm3323_init() and
> cm3323_probe(). cm3323_init() is called by cm3323_probe() , so using
> dev_err_probe() ensures that deferred probing is handled
> correctly and simplifies error paths.
>
> Remove the redundant error message in cm3323_probe().
>
> Tested on a Raspberry Pi 3B using i2c-stub. The driver probes
> successfully and successfully read integration_time after this change.
...
> + return dev_err_probe(&data->client->dev, ret,
> + "Error reading reg_conf\n");
Add
struct device *dev = &data->client->dev;
at the top of the function and make these just to be one-liners.
--
With Best Regards,
Andy Shevchenko