Hi Andy, Thanks for the feedback. > Subject: Re: [PATCH] iio: accel: adxl345: Convert enum->pointer for data > in match data table > > On Sat, Aug 12, 2023 at 4:38 PM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> > wrote: > > > > Convert enum->pointer for data in match data table, so that > > device_get_match_data() can do match against OF/ACPI/I2C tables, once > > i2c bus type match support added to it. > > > > Add struct adxl3x5_chip_info and replace enum->adxl3x5_chip_info in > > the match table and simplify adxl345_probe(). > > ... > > > + info = device_get_match_data(dev); > > + if (info->type != ADXL345 && info->type != ADXL375) > > return -EINVAL; > > I would rather use switch-case. OK, will use switch case. > Anyway, same comments here as for the other patch: ENODEV and trailing > commas. OK. If there is no objections. > > ... > > > +static const struct adxl3x5_chip_info adxl345_i2c_info = { > > + .name = "adxl345", > > + .type = ADXL345 > > +}; > > + > > +static const struct adxl3x5_chip_info adxl375_i2c_info = { > > + .name = "adxl375", > > + .type = ADXL375 > > +}; > > > +static const struct adxl3x5_chip_info adxl345_spi_info = { > > + .name = "adxl345", > > + .type = ADXL345 > > +}; > > + > > +static const struct adxl3x5_chip_info adxl375_spi_info = { > > + .name = "adxl375", > > + .type = ADXL375 > > +}; > > Why dup? Because it i2c and spi table. Anyway I requested Angel Iglesias to use unified table for bmp280_i2c() and bmp280_spi() and if it is do able, create a separate patch. Cheers, Biju > > -- > With Best Regards, > Andy Shevchenko