diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-03-23 13:41:27 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2020-04-19 18:56:19 +0300 |
commit | df6e71256c84c4c232107a4074572ea150851d15 (patch) | |
tree | 17dc6cd2777f7023d40828219eafb06ca04612a2 /drivers/iio/pressure | |
parent | 6085102c494b8afc62bc093f8f32d6248f6d33e5 (diff) | |
download | linux-df6e71256c84c4c232107a4074572ea150851d15.tar.xz |
iio: pressure: bmp280: Explicitly mark GPIO optional
Show by using a corresponding API call that GPIO is optional.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/pressure')
-rw-r--r-- | drivers/iio/pressure/bmp280-core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c index ce0c1962d9f8..263a74666c1e 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); } |