diff mbox series

[v2,04/22] iio: accel: adxl345: rename to adxl34x_channels

Message ID 20241117182651.115056-5-l.rubusch@gmail.com (mailing list archive)
State Changes Requested
Headers show
Series iio: accel: adxl345: add FIFO operating with IRQ triggered watermark events | expand

Commit Message

Lothar Rubusch Nov. 17, 2024, 6:26 p.m. UTC
Rename the "adxl345_channels" to "adxl34x_channels". The driver
supports several Analog accelerometers equally, e.g. adxl346 and
adxl375.

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
---
 drivers/iio/accel/adxl345_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jonathan Cameron Nov. 24, 2024, 6:02 p.m. UTC | #1
On Sun, 17 Nov 2024 18:26:33 +0000
Lothar Rubusch <l.rubusch@gmail.com> wrote:

> Rename the "adxl345_channels" to "adxl34x_channels". The driver
> supports several Analog accelerometers equally, e.g. adxl346 and
> adxl375.
As with previous a no to this.

We have a few drivers doing wild cards, but most are from before
I realised how often this goes wrong and started pretty strongly
insisting on naming after a single support part. It seems
so attractive, but ends up hurting us more than the confusion of
a single name applying to other parts as well.

Jonathan

> 
> Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
> ---
>  drivers/iio/accel/adxl345_core.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/accel/adxl345_core.c b/drivers/iio/accel/adxl345_core.c
> index 30896555a4..2b62e79248 100644
> --- a/drivers/iio/accel/adxl345_core.c
> +++ b/drivers/iio/accel/adxl345_core.c
> @@ -33,7 +33,7 @@ struct adxl34x_state {
>  		BIT(IIO_CHAN_INFO_SAMP_FREQ),				\
>  }
>  
> -static const struct iio_chan_spec adxl345_channels[] = {
> +static const struct iio_chan_spec adxl34x_channels[] = {
>  	ADXL345_CHANNEL(0, X),
>  	ADXL345_CHANNEL(1, Y),
>  	ADXL345_CHANNEL(2, Z),
> @@ -203,8 +203,8 @@ int adxl345_core_probe(struct device *dev, struct regmap *regmap,
>  	indio_dev->name = st->info->name;
>  	indio_dev->info = &adxl345_info;
>  	indio_dev->modes = INDIO_DIRECT_MODE;
> -	indio_dev->channels = adxl345_channels;
> -	indio_dev->num_channels = ARRAY_SIZE(adxl345_channels);
> +	indio_dev->channels = adxl34x_channels;
> +	indio_dev->num_channels = ARRAY_SIZE(adxl34x_channels);
>  
>  	if (setup) {
>  		/* Perform optional initial bus specific configuration */
diff mbox series

Patch

diff --git a/drivers/iio/accel/adxl345_core.c b/drivers/iio/accel/adxl345_core.c
index 30896555a4..2b62e79248 100644
--- a/drivers/iio/accel/adxl345_core.c
+++ b/drivers/iio/accel/adxl345_core.c
@@ -33,7 +33,7 @@  struct adxl34x_state {
 		BIT(IIO_CHAN_INFO_SAMP_FREQ),				\
 }
 
-static const struct iio_chan_spec adxl345_channels[] = {
+static const struct iio_chan_spec adxl34x_channels[] = {
 	ADXL345_CHANNEL(0, X),
 	ADXL345_CHANNEL(1, Y),
 	ADXL345_CHANNEL(2, Z),
@@ -203,8 +203,8 @@  int adxl345_core_probe(struct device *dev, struct regmap *regmap,
 	indio_dev->name = st->info->name;
 	indio_dev->info = &adxl345_info;
 	indio_dev->modes = INDIO_DIRECT_MODE;
-	indio_dev->channels = adxl345_channels;
-	indio_dev->num_channels = ARRAY_SIZE(adxl345_channels);
+	indio_dev->channels = adxl34x_channels;
+	indio_dev->num_channels = ARRAY_SIZE(adxl34x_channels);
 
 	if (setup) {
 		/* Perform optional initial bus specific configuration */