From: Michael Walle <michael@walle.cc>
To: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org
Cc: Mark Brown <broonie@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
Michael Walle <michael@walle.cc>
Subject: [PATCH 2/2] gpio: regmap: use new regmap_might_sleep()
Date: Fri, 30 Apr 2021 15:06:45 +0200 [thread overview]
Message-ID: <20210430130645.31562-2-michael@walle.cc> (raw)
In-Reply-To: <20210430130645.31562-1-michael@walle.cc>
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>
---
drivers/gpio/gpio-regmap.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c
index 134cedf151a7..706f6c34696e 100644
--- a/drivers/gpio/gpio-regmap.c
+++ b/drivers/gpio/gpio-regmap.c
@@ -259,14 +259,7 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
chip->of_node = to_of_node(config->fwnode);
#endif /* CONFIG_OF_GPIO */
- /*
- * 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(gpio->regmap);
chip->get = gpio_regmap_get;
if (gpio->reg_set_base && gpio->reg_clr_base)
--
2.20.1
next prev parent reply other threads:[~2021-04-30 13:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-30 13:06 [PATCH 1/2] regmap: add regmap_might_sleep() Michael Walle
2021-04-30 13:06 ` Michael Walle [this message]
2021-04-30 15:19 ` Mark Brown
2021-04-30 16:01 ` Michael Walle
2021-04-30 17:26 ` Mark Brown
2021-04-30 22:10 ` Michael Walle
2021-05-06 12:43 ` Mark Brown
2021-05-06 13:35 ` Michael Walle
2021-05-06 15:53 ` Mark Brown
2022-11-21 15:08 Michael Walle
2022-11-21 15:08 ` [PATCH 2/2] gpio: regmap: use new regmap_might_sleep() Michael Walle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210430130645.31562-2-michael@walle.cc \
--to=michael@walle.cc \
--cc=andy.shevchenko@gmail.com \
--cc=bgolaszewski@baylibre.com \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).