[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241114231002.98595-4-l.rubusch@gmail.com>
Date: Thu, 14 Nov 2024 23:09:43 +0000
From: Lothar Rubusch <l.rubusch@...il.com>
To: lars@...afoo.de,
Michael.Hennerich@...log.com,
jic23@...nel.org,
linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: l.rubusch@....ch,
Lothar Rubusch <l.rubusch@...il.com>
Subject: [PATCH 03/22] iio: accel: adxl345: rename struct adxl34x_state
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.
Signed-off-by: Lothar Rubusch <l.rubusch@...il.com>
---
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 |
--
2.39.2
Powered by blists - more mailing lists