[PATCH v3 4/9] iio: amplifiers: ad8366: drop reset_gpio from private struct
From: Rodrigo Alencar via B4 Relay
Date: Tue Feb 03 2026 - 06:30:24 EST
From: Rodrigo Alencar <rodrigo.alencar@xxxxxxxxxx>
Remove reset_gpio from the device state struct and turn it
into a local variable, as it is not being used anywhere else.
Signed-off-by: Rodrigo Alencar <rodrigo.alencar@xxxxxxxxxx>
---
drivers/iio/amplifiers/ad8366.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/amplifiers/ad8366.c b/drivers/iio/amplifiers/ad8366.c
index f0d44f2769ca..d6e18eb71bc8 100644
--- a/drivers/iio/amplifiers/ad8366.c
+++ b/drivers/iio/amplifiers/ad8366.c
@@ -42,7 +42,6 @@ struct ad8366_state {
struct spi_device *spi;
struct regulator *reg;
struct mutex lock; /* protect sensor state */
- struct gpio_desc *reset_gpio;
unsigned char ch[2];
enum ad8366_type type;
const struct ad8366_info *info;
@@ -245,6 +244,7 @@ static const struct iio_chan_spec ada4961_channels[] = {
static int ad8366_probe(struct spi_device *spi)
{
+ struct gpio_desc *reset_gpio;
struct iio_dev *indio_dev;
struct ad8366_state *st;
int ret;
@@ -279,9 +279,9 @@ static int ad8366_probe(struct spi_device *spi)
case ID_ADL5240:
case ID_HMC792:
case ID_HMC1119:
- st->reset_gpio = devm_gpiod_get_optional(&spi->dev, "reset", GPIOD_OUT_HIGH);
- if (IS_ERR(st->reset_gpio)) {
- ret = PTR_ERR(st->reset_gpio);
+ reset_gpio = devm_gpiod_get_optional(&spi->dev, "reset", GPIOD_OUT_HIGH);
+ if (IS_ERR(reset_gpio)) {
+ ret = PTR_ERR(reset_gpio);
goto error_disable_reg;
}
indio_dev->channels = ada4961_channels;
--
2.43.0