Skip to content

Commit 671b9b6

Browse files
salah-trikijic23
authored andcommitted
iio: pressure: bmp280: Use gpiod_set_value_cansleep()
Replace `gpiod_set_value()` with `gpiod_set_value_cansleep()`, which is required when the GPIO controller is connected via a slow bus such as I2C. This is also safe to use in sleepable contexts like the driver probe function. Signed-off-by: Salah Triki <salah.triki@gmail.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 6233067 commit 671b9b6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/iio/pressure/bmp280-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3212,7 +3212,7 @@ int bmp280_common_probe(struct device *dev,
32123212
return dev_err_probe(dev, PTR_ERR(gpiod), "failed to get reset GPIO\n");
32133213

32143214
/* Deassert the signal */
3215-
gpiod_set_value(gpiod, 0);
3215+
gpiod_set_value_cansleep(gpiod, 0);
32163216

32173217
data->regmap = regmap;
32183218

0 commit comments

Comments
 (0)