Re: [PATCH 2/3] iio: light: vcnl4000: drop enum id table in favor of chip structs

From: Andy Shevchenko

Date: Thu Apr 02 2026 - 04:26:58 EST


On Wed, Apr 01, 2026 at 02:22:37PM +0300, Erikas Bitovtas wrote:
> Instead of creating an enum table with chip IDs, store pointers to
> structs directly. This drops the association between chip structs and
> enum IDs and allows for easier addition or removal of new devices.

...

> static const struct of_device_id vcnl_4000_of_match[] = {
> {
> .compatible = "capella,cm36672p",
> - .data = (void *)CM36672P,
> + .data = &cm36672p_spec,
> },

Also can be collapsed to smaller number of LoC.

{ .compatible = "capella,cm36672p", .data = &cm36672p_spec, },

But I fine with current approach. If you want to collapse, it's probably better
to do in a separate patch.

--
With Best Regards,
Andy Shevchenko