Re: [PATCH v3] iio: amplifiers: ad8366: Change devm_gpiod_get() to optional and add the missed check

From: Markus Elfring
Date: Wed Jun 03 2020 - 14:00:45 EST


> Since if there is no GPIO, nothing happens, replace devm_gpiod_get()
> with devm_gpiod_get_optional().

â
> +++ b/drivers/iio/amplifiers/ad8366.c
> @@ -262,8 +262,12 @@ static int ad8366_probe(struct spi_device *spi)
â
> case ID_HMC1119:
> - st->reset_gpio = devm_gpiod_get(&spi->dev, "reset",
> + st->reset_gpio = devm_gpiod_get_optional(&spi->dev, "reset",
> GPIOD_OUT_HIGH);
â

I suggest to choose an other source code formatting for this statement.

A)
+ st->reset_gpio = devm_gpiod_get_optional(&spi->dev, "reset",
+ GPIOD_OUT_HIGH);

B)
+ st->reset_gpio = devm_gpiod_get_optional(&spi->dev, "reset", GPIOD_OUT_HIGH);
- GPIOD_OUT_HIGH);


Regards,
Markus