[PATCH v5 2/5] staging: iio: adc: ad7816: Rename state structure

Gabriel Shahrouzi
2025-04-20T01:49:14Z

Rename the main driver state structure from 'ad7816_chip_info' to
'ad7816_state' to avoid confusion with the upcoming structure that will
hold static, per-device-type information.

This is purely a mechanical rename with no functional changes.

Signed-off-by: Gabriel Shahrouzi <gshahrouzi@gmail.com>
---
drivers/staging/iio/adc/ad7816.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
index a44b0c8c82b12..cad2e55aff3f9 100644
--- a/drivers/staging/iio/adc/ad7816.c
+++ b/drivers/staging/iio/adc/ad7816.c
@@ -38,10 +38,10 @@
#define AD7816_TEMP_FLOAT_MASK 0x3

/*
- * struct ad7816_chip_info - chip specific information
+ * struct ad7816_state - chip specific information
*/

-struct ad7816_chip_info {
+struct ad7816_state {
kernel_ulong_t id;
struct spi_device *spi_dev;
struct gpio_desc *rdwr_pin;
@@ -61,7 +61,7 @@ enum ad7816_type {
/*
* ad7816 data access by SPI
*/
-static int ad7816_spi_read(struct ad7816_chip_info *chip, u16 *data)
+static int ad7816_spi_read(struct ad7816_state *chip, u16 *data)
{
struct spi_device *spi_dev = chip->spi_dev;
int ret;
@@ -102,7 +102,7 @@ static int ad7816_spi_read(struct ad7816_chip_info *chip, u16 *data)
return ret;
}

-static int ad7816_spi_write(struct ad7816_chip_info *chip, u8 data)
+static int ad7816_spi_write(struct ad7816_state *chip, u8 data)
{
struct spi_device *spi_dev = chip->spi_dev;
int ret;
@@ -121,7 +121,7 @@ static ssize_t ad7816_show_mode(struct device *dev,
char *buf)
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
- struct ad7816_chip_info *chip = iio_priv(indio_dev);
+ struct ad7816_state *chip = iio_priv(indio_dev);

if (chip->mode)
return sprintf(buf, "power-save\n");
@@ -134,7 +134,7 @@ static ssize_t ad7816_store_mode(struct device *dev,
size_t len)
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
- struct ad7816_chip_info *chip = iio_priv(indio_dev);
+ struct ad7816_state *chip = iio_priv(indio_dev);

if (strcmp(buf, "full")) {
gpiod_set_value(chip->rdwr_pin, 1);
@@ -167,7 +167,7 @@ static ssize_t ad7816_show_channel(struct device *dev,
char *buf)
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
- struct ad7816_chip_info *chip = iio_priv(indio_dev);
+ struct ad7816_state *chip = iio_priv(indio_dev);

return sprintf(buf, "%d\n", chip->channel_id);
}
@@ -178,7 +178,7 @@ static ssize_t ad7816_store_channel(struct device *dev,
size_t len)
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
- struct ad7816_chip_info *chip = iio_priv(indio_dev);
+ struct ad7816_state *chip = iio_priv(indio_dev);
unsigned long data;
int ret;

@@ -215,7 +215,7 @@ static ssize_t ad7816_show_value(struct device *dev,
char *buf)
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
- struct ad7816_chip_info *chip = iio_priv(indio_dev);
+ struct ad7816_state *chip = iio_priv(indio_dev);
u16 data;
s8 value;
int ret;
@@ -271,7 +271,7 @@ static ssize_t ad7816_show_oti(struct device *dev,
char *buf)
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
- struct ad7816_chip_info *chip = iio_priv(indio_dev);
+ struct ad7816_state *chip = iio_priv(indio_dev);
int value;

if (chip->channel_id > AD7816_CS_MAX) {
@@ -292,7 +292,7 @@ static inline ssize_t ad7816_set_oti(struct device *dev,
size_t len)
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
- struct ad7816_chip_info *chip = iio_priv(indio_dev);
+ struct ad7816_state *chip = iio_priv(indio_dev);
long value;
u8 data;
int ret;
@@ -351,7 +351,7 @@ static const struct iio_info ad7816_info = {

static int ad7816_probe(struct spi_device *spi_dev)
{
- struct ad7816_chip_info *chip;
+ struct ad7816_state *chip;
struct iio_dev *indio_dev;
int i, ret;

--
2.43.0