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 <[email protected]> Reviewed-by: David Lechner <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 6233067 commit 671b9b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)