aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/gpio/gpio-regmap.c
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2023-01-05 16:06:03 +0100
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2023-01-30 15:55:29 +0100
commit297a44f664a8ac2139c25c51ba0064cc12a6f1e5 (patch)
tree76fd83afafe64ec630bb47440e615bcb1cb1aaf4 /drivers/gpio/gpio-regmap.c
parentgpiolib: sort header inclusion alphabetically (diff)
downloadwireguard-linux-297a44f664a8ac2139c25c51ba0064cc12a6f1e5.tar.xz
wireguard-linux-297a44f664a8ac2139c25c51ba0064cc12a6f1e5.zip
gpio: regmap: use new regmap_might_sleep()
Now that the regmap can be queried whether it might sleep, we can get rid of the conservative setting "can_sleep = true". New drivers which want to use gpio-regmap and can access the registers memory-mapped won't have the restriction that their consumers have to use the gpiod_*cansleep() variants anymore. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-regmap.c')
-rw-r--r--drivers/gpio/gpio-regmap.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c
index f907c9c19fce..fca17d478984 100644
--- a/drivers/gpio/gpio-regmap.c
+++ b/drivers/gpio/gpio-regmap.c
@@ -254,15 +254,7 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
chip->ngpio = config->ngpio;
chip->names = config->names;
chip->label = config->label ?: dev_name(config->parent);
-
- /*
- * If our regmap is fast_io we should probably set can_sleep to false.
- * Right now, the regmap doesn't save this property, nor is there any
- * access function for it.
- * The only regmap type which uses fast_io is regmap-mmio. For now,
- * assume a safe default of true here.
- */
- chip->can_sleep = true;
+ chip->can_sleep = regmap_might_sleep(config->regmap);
chip->get = gpio_regmap_get;
if (gpio->reg_set_base && gpio->reg_clr_base)