On Sat, Aug 12, 2023 at 06:13:30PM +0100, Biju Das wrote: > Convert enum->pointer for data in the match tables, so that > device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c > bus type match support added to it. > > Replace enum->struct *atlas_device for data in the match table. Simplify > the probe() by replacing device_get_match_data() and ID lookup for > retrieving data by i2c_get_match_data(). > > While at it, add const qualifier to struct atlas_device and drop unused > id variable from probe(). Same comments for id variable removal. With that addressed and below remark, Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> ... > static const struct of_device_id atlas_dt_ids[] = { > - { .compatible = "atlas,ph-sm", .data = (void *)ATLAS_PH_SM, }, > - { .compatible = "atlas,ec-sm", .data = (void *)ATLAS_EC_SM, }, > - { .compatible = "atlas,orp-sm", .data = (void *)ATLAS_ORP_SM, }, > - { .compatible = "atlas,do-sm", .data = (void *)ATLAS_DO_SM, }, > - { .compatible = "atlas,rtd-sm", .data = (void *)ATLAS_RTD_SM, }, > + { .compatible = "atlas,ph-sm", .data = &atlas_devices[ATLAS_PH_SM], }, > + { .compatible = "atlas,ec-sm", .data = &atlas_devices[ATLAS_EC_SM], }, > + { .compatible = "atlas,orp-sm", .data = &atlas_devices[ATLAS_ORP_SM], }, > + { .compatible = "atlas,do-sm", .data = &atlas_devices[ATLAS_DO_SM], }, > + { .compatible = "atlas,rtd-sm", .data = &atlas_devices[ATLAS_RTD_SM], }, Now drop inner trailing commas. > { } > }; -- With Best Regards, Andy Shevchenko