Re: [PATCH v3 1/4] iio: light: ltr501: Switch to read_avail() op from manual attribute registration
From: Andy Shevchenko
Date: Mon Nov 09 2026 - 15:05:37 EST
On Sun, Nov 08, 2026 at 11:42:50AM +0200, Svyatoslav Ryhel wrote:
> Switch to the read_avail() operation from manual attribute group
> registration. This eliminates the need for per-chip attribute_group
> structures and related ltr501_chip_info iio_info entries.
>
> Adjust LTR501_INTENSITY_CHANNEL to account for the new
> info_mask_*_available layout, allowing the removal of _shared since all
> intensity channels share the same layout of available entries.
...
> +static const int int_time_avail[] = {
> + 0, 50000,
> + 0, 100000,
> + 0, 200000,
> + 0, 400000
> +};
> +
> +static const int samp_freq_avail[] = {
> + 20, 0,
> + 10, 0,
> + 5, 0,
> + 2, 0,
> + 1, 0,
> + 0, 500000
> +};
When an entry is not a clear terminator, add trailing comma.
On top of that it's better to use 2d arrays (yes, it will need some casting,
but this will make it clear that there is a tighten dependency between odd
and even indices).
--
With Best Regards,
Andy Shevchenko