Re: [PATCH v5 2/3] iio: adc: Support ROHM BD79112 ADC/GPIO

Matti Vaittinen
2025-09-16T08:04:19Z

On 16/09/2025 10:39, Andy Shevchenko wrote:
> On Tue, Sep 16, 2025 at 7:48 AM Matti Vaittinen
> <mazziesaccount@gmail.com> wrote:
>> On 15/09/2025 17:12, Andy Shevchenko wrote:
>>> On Mon, Sep 15, 2025 at 10:12:43AM +0300, Matti Vaittinen wrote:
> ...
>
>>>> + devm_spi_optimize_message(dev, spi, &data->read_msg);
>>>
>>> And if it fails?..
>>
>> I am not really sure under what conditions this would fail. Without
>> taking a further look at that - then we just use unoptimized SPI
>> transfers(?). Could warrant a warning print though.
>
> What is the point of having devm_ variant for it if it never fails, please?

I didn't say it never fails. I said that I don't know what can cause the
failure. Because I don't know this, I can't say if it is reasonable to
assume the SPI (or the system in general) are in unusable state making
the failure a show-stopper for this driver.

If the failure is indicating "only" a failure of "optimization" this
call does, then the driver should still be able to do it's job even if
the SPI performance was reduced. Hence aborting the probe might not be
necessary but the driver could proceed - although emitting a warning
should make sense.

Well, I presume failing of the devm_spi_optimize_message() is not likely
to happen if system is working correctly. Thus I'm not against
Jonathan's edit which aborts the probe.

Yours,
-- Matti