Re: [PATCH v5 5/7] iio: accel: kionix-kx022a: Refactor driver and add chip_info structure

From: Andy Shevchenko
Date: Mon Jun 12 2023 - 11:55:44 EST


On Mon, Jun 12, 2023 at 04:22:08PM +0200, Mehdi Djait wrote:
> Add the chip_info structure to the driver's private data to hold all
> the device specific infos.
> Refactor the kx022a driver implementation to make it more generic and
> extensible.

...

> + chip_info = spi_get_device_match_data(spi);

Missing check. You addressed only I²C case. Is there any explanation?

...

> struct kx022a_data {
> + const struct kx022a_chip_info *chip_info;
> struct regmap *regmap;

I would suggest to run bloat-o-meter with this version and if you place
chip_info after regmap. Does it gain us some memory?

> struct iio_trigger *trig;
> struct device *dev;

--
With Best Regards,
Andy Shevchenko