Re: [PATCH v5 08/18] iio: magnetometer: ak8975: check if gpiod read was successful

From: Andy Shevchenko

Date: Wed May 06 2026 - 03:11:08 EST


On Tue, May 05, 2026 at 08:09:22PM -0500, Maxwell Doose wrote:
> On Tue May 5, 2026 at 6:46 AM CDT, Joshua Crofts via B4 Relay wrote:

...

> Small nit but I wonder if we can change:
>
> if (val < 0) {
> dev_err(&client->dev, "Error in reading GPIOD\n");
> return val;
> }
>
> to something like:
>
> if (val < 0)
> return dev_err_probe(&client->dev, val, "Error in reading GPIOD\n");
>
> Would be good for code density.

Not in this patch. IIRC we have a dedicated change for dev_err_probe()
conversion. Also note, dev_err_probe() is only applicable to the functions
that are part of the probe stage and probe stage only. If the function shared
between probe and run-time, the dev_err_probe() has not to be used.

--
With Best Regards,
Andy Shevchenko