iio: amplifiers: ad8366: Change devm_gpiod_get() to optional and add the missed check
Quoted 2 lines
Since if there is no GPIO, nothing happens, replace
devm_gpiod_get()withdevm_gpiod_get_optional().
…
Quoted 2 lines
+++
b/drivers/iio/amplifiers/ad8366.c(quoted diff) +0
-0@@ -262,8 +262,12 @@ static int ad8366_probe(struct spi_device *spi)
…
Review
Quoted 4 lines
(quoted diff) +1
-1case 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