From: Gabriel Shahrouzi <gshahrouzi@gmail.com>
To: gregkh@linuxfoundation.org, jic23@kernel.org, lars@metafoo.de,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-staging@lists.linux.dev, Michael.Hennerich@analog.com,
sonic.zhang@analog.com, vapier@gentoo.org
Cc: gshahrouzi@gmail.com, skhan@linuxfoundation.org,
linux-kernel-mentees@lists.linux.dev
Subject: [PATCH v5 2/5] staging: iio: adc: ad7816: Rename state structure
Date: Sat, 19 Apr 2025 21:49:07 -0400 [thread overview]
Message-ID: <20250420014910.849934-3-gshahrouzi@gmail.com> (raw)
In-Reply-To: <20250420014910.849934-1-gshahrouzi@gmail.com>
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
next prev parent reply other threads:[~2025-04-20 1:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-20 1:49 [PATCH v5 0/5] staging: iio: adc: ad7816: Fix channel handling and refactor Gabriel Shahrouzi
2025-04-20 1:49 ` [PATCH v5 1/5] staging: iio: adc: ad7816: Allow channel 7 for all devices Gabriel Shahrouzi
2025-04-21 12:29 ` Jonathan Cameron
2025-04-20 1:49 ` Gabriel Shahrouzi [this message]
2025-04-20 1:49 ` [PATCH v5 3/5] staging: iio: adc: ad7816: Introduce chip_info and use pointer matching Gabriel Shahrouzi
2025-04-21 12:34 ` Jonathan Cameron
2025-04-20 1:49 ` [PATCH v5 4/5] staging: iio: adc: ad7816: Use chip_info for device capabilities Gabriel Shahrouzi
2025-04-21 12:35 ` Jonathan Cameron
2025-04-20 1:49 ` [PATCH v5 5/5] staging: iio: adc: ad7816: Simplify channel validation using chip_info Gabriel Shahrouzi
2025-04-21 12:37 ` Jonathan Cameron
2025-04-21 11:31 ` [PATCH v5 0/5] staging: iio: adc: ad7816: Fix channel handling and refactor Jonathan Cameron
2025-04-21 13:49 ` Gabriel Shahrouzi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250420014910.849934-3-gshahrouzi@gmail.com \
--to=gshahrouzi@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=skhan@linuxfoundation.org \
--cc=sonic.zhang@analog.com \
--cc=vapier@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox