On Sun, 17 Nov 2024 18:26:32 +0000 Lothar Rubusch <l.rubusch@xxxxxxxxx> wrote: > Rename the struct "adxl345_data" to "adxl34x_state". First, the > data structure is supposed to be extended to represent state rather than > only hold sensor data. The data will be a separate member pointer. > Second, the driver not only covers the adxl345 accelerometer, it also > supports the adxl345, adxl346 and adxl375. Thus "adxl34x_" is a choice > for a common prefix. No to the wild card x. Long experience has shown that manufacturers almost never respect naming sequences so we simply name everything after one supported part number. It seems like a good idea, but we've been bitten before. I'm fine with the _data to _state change but please combine with the previous patch to void unnecessary churn where the same line gets updated twice. These two changes are very closely related so fine to do them in one patch in my opinion. > > Signed-off-by: Lothar Rubusch <l.rubusch@xxxxxxxxx> > --- > drivers/iio/accel/adxl345_core.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/iio/accel/adxl345_core.c b/drivers/iio/accel/adxl345_core.c > index 3fb7a7b1b7..30896555a4 100644 > --- a/drivers/iio/accel/adxl345_core.c > +++ b/drivers/iio/accel/adxl345_core.c > @@ -17,7 +17,7 @@ > > #include "adxl345.h" > > -struct adxl345_data { > +struct adxl34x_state { > const struct adxl345_chip_info *info; > struct regmap *regmap; > }; > @@ -43,7 +43,7 @@ static int adxl345_read_raw(struct iio_dev *indio_dev, > struct iio_chan_spec const *chan, > int *val, int *val2, long mask) > { > - struct adxl345_data *st = iio_priv(indio_dev); > + struct adxl34x_state *st = iio_priv(indio_dev); > __le16 accel; > long long samp_freq_nhz; > unsigned int regval; > @@ -99,7 +99,7 @@ static int adxl345_write_raw(struct iio_dev *indio_dev, > struct iio_chan_spec const *chan, > int val, int val2, long mask) > { > - struct adxl345_data *st = iio_priv(indio_dev); > + struct adxl34x_state *st = iio_priv(indio_dev); > s64 n; > > switch (mask) { > @@ -181,7 +181,7 @@ static void adxl345_powerdown(void *regmap) > int adxl345_core_probe(struct device *dev, struct regmap *regmap, > int (*setup)(struct device*, struct regmap*)) > { > - struct adxl345_data *st; > + struct adxl34x_state *st; > struct iio_dev *indio_dev; > u32 regval; > unsigned int data_format_mask = (ADXL345_DATA_FORMAT_RANGE |