Re: [PATCH v1 09/10] mfd: motorola-cpcap: diverge configuration per-board

Andy Shevchenko
2026-01-26T10:13:37Z

On Sun, Jan 25, 2026 at 03:43:01PM +0200, Svyatoslav Ryhel wrote:
> MFD have rigid subdevice structure which does not allow flexible dynamic
> subdevice linking. Address this by diverging CPCAP subdevice composition
> to take into account board specific configuration.
>
> Create a common default subdevice composition, rename existing subdevice
> composition into cpcap_mapphone_mfd_devices since it targets mainly
> Mapphone board.

...

> +#include <linux/of.h>

Why?

...

> + cpcap->cdata = of_device_get_match_data(&spi->dev);

device_get_match_data() from property.h.

> + if (!cpcap->cdata)
> + return -ENODEV;
> +

...

> +static const struct of_device_id cpcap_of_match[] = {
> + { .compatible = "motorola,cpcap", .data = &cpcap_default_data },
> + { .compatible = "st,6556002", .data = &cpcap_default_data },
> + { .compatible = "motorola,mapphone-cpcap", .data = &cpcap_mapphone_data },

> + { /* sentinel */ },

No trailing comma for sentinel.

> +};
> +MODULE_DEVICE_TABLE(of, cpcap_of_match);

--
With Best Regards,
Andy Shevchenko