Re: [PATCH 1/7] iio: frequency: adrf6780: use dev_err_probe in probe path
From: Andy Shevchenko
Date: Fri Feb 20 2026 - 08:58:06 EST
On Fri, Feb 20, 2026 at 03:11:39PM +0200, Antoniu Miclaus wrote:
> Replace dev_err() + return with dev_err_probe() in adrf6780_reset()
> and adrf6780_init(), which are called during probe. This simplifies
> error handling.
...
> ret = __adrf6780_spi_update_bits(st, ADRF6780_REG_CONTROL,
> ADRF6780_SOFT_RESET_MSK,
> FIELD_PREP(ADRF6780_SOFT_RESET_MSK, 1));
> - if (ret) {
> - dev_err(&spi->dev, "ADRF6780 SPI software reset failed.\n");
> - return ret;
> - }
> + if (ret)
> + return dev_err_probe(&spi->dev, ret,
> + "ADRF6780 SPI software reset failed.\n");
Consider adding
struct device *dev = &spi->dev;
at the top, so this line becomes
return dev_err_probe(dev, ret, "ADRF6780 SPI software reset failed.\n");
(while at it, I would dare to drop 'SPI' from the message as is easy to derive that
the device in question is connected to SPI bus.)
return dev_err_probe(dev, ret, "ADRF6780 software reset failed.\n");
...
Ditto for the rest.
--
With Best Regards,
Andy Shevchenko