From: Andy Shevchenko Date: Mon, 23 Mar 2020 10:41:27 +0000 (+0200) Subject: iio: pressure: bmp280: Explicitly mark GPIO optional X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=df6e71256c84c4c232107a4074572ea150851d15;p=linux.git iio: pressure: bmp280: Explicitly mark GPIO optional Show by using a corresponding API call that GPIO is optional. Signed-off-by: Andy Shevchenko Acked-by: Linus Walleij Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c index ce0c1962d9f8c..263a74666c1e7 100644 --- a/drivers/iio/pressure/bmp280-core.c +++ b/drivers/iio/pressure/bmp280-core.c @@ -1066,9 +1066,9 @@ int bmp280_common_probe(struct device *dev, usleep_range(data->start_up_time, data->start_up_time + 100); /* Bring chip out of reset if there is an assigned GPIO line */ - gpiod = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); + gpiod = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); /* Deassert the signal */ - if (!IS_ERR(gpiod)) { + if (gpiod) { dev_info(dev, "release reset\n"); gpiod_set_value(gpiod, 0); }