Re: [PATCH v5 08/18] iio: magnetometer: ak8975: check if gpiod read was successful
From: Maxwell Doose
Date: Wed May 06 2026 - 03:11:38 EST
On Wed, May 6, 2026 at 2:08 AM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxx> wrote:
>
> 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.
>
Understood; I'll take that into account for the future, thanks for that tip.
best regards,
max
> --
> With Best Regards,
> Andy Shevchenko
>
>