Re: [PATCH] iio: adc: ti-ads1015: support deferred probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 04, 2023 at 01:15:22PM +0300, Tomas Melin wrote:
> Support deferred probe for cases where communication on
> i2c bus fails. These failures could happen for a variety of
> reasons including bus arbitration error or power failure.

> +out:
> +	if ((ret == -EAGAIN) || (ret == -ENXIO))
> +		return -EPROBE_DEFER;
> +	return ret;

Oh my... This looks so-o hackish.
If anything, it has to be fixed on the level of regmap I2C APIs or so.

Maybe something like regmap_i2c_try_write()/try_read() new APIs that
will provide the above. Otherwise you want to fix _every single driver_
in the Linux kernel

...

$ git grep -lw builtin_i2c_driver | wc
      5       5     123
$ git grep -lw module_i2c_driver | wc
      1164    1164   35240

(and more that don't use either of the above macros).

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux