Re: [PATCH v3] staging: iio: adc: ad7816: Use devm_gpiod_get_optional() for busy GPIO

From: Dan Carpenter

Date: Fri Jul 10 2026 - 13:03:57 EST


On Fri, Jul 10, 2026 at 04:00:01PM +0000, Taha Narimani wrote:
> /*
> * struct ad7816_chip_info - chip specific information
> @@ -48,7 +48,7 @@ struct ad7816_chip_info {
> struct gpio_desc *convert_pin;
> struct gpio_desc *busy_pin;
> u8 oti_data[AD7816_CS_MAX + 1];
> - u8 channel_id; /* 0 always be temperature */
> + u8 channel_id; /* 0 always be temperature */

What changed here??

> u8 mode;
> };
>
> @@ -84,10 +84,8 @@ static int ad7816_spi_read(struct ad7816_chip_info *chip, u16 *data)
> gpiod_set_value(chip->convert_pin, 1);
> }
>
> -if (chip->id == ID_AD7816 || chip->id == ID_AD7817) {
> - while (gpiod_get_value(chip->busy_pin))
> - cpu_relax();

This patch doesn't apply. Not sure what went wrong but maybe it's
related to this?

> - }
> + while (gpiod_get_value(chip->busy_pin))
> + cpu_relax();
>
> gpiod_set_value(chip->rdwr_pin, 0);
> gpiod_set_value(chip->rdwr_pin, 1);

regards,
dan carpenter