Re: [PATCH 06/35] iio: adc: ad7768-1: use default_trigger
From: Joshua Crofts
Date: Wed Nov 18 2026 - 03:44:53 EST
On Mon, 16 Nov 2026 01:47:54 +0000
Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
> From: Jonathan Cameron <jonathan.cameron@xxxxxxxxxxxxxxxx>
>
> Set indio_dev->default_trigger rather than taking a reference to the
> trigger in probe(). The IIO core now takes the reference during
> iio_device_register(), so it is not leaked if probe() fails after
> the trigger is set up. This avoids fragile ordering requirements
> in probe().
>
> Fixes: a5f8c7da3dbe ("iio: adc: Add AD7768-1 ADC basic support")
Sashiko points out the Fixes tag is probably incorrect (and I agree). Commit a5f8c7da3dbe
set indio_dev->modes = INDIO_DIRECT_MODE | INDIO_BUFFER_TRIGGERED, which guaranteed
trigger unregistering on driver exit (I checked and it does this by bitwise & with the
INDIO_ALL_TRIGGERED_MODE). This behaviour was then removed with:
bca036de0ab2 ("iio: adc: ad778-1: do not explicity set INDIO_BUFFER_TRIGGERED mode")
--
Kind regards,
Joshua Crofts