diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-17 13:46:00 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-03-05 10:05:08 -0500 |
commit | e4e449e82871c53ef3b22bd3a50fceabc0638926 (patch) | |
tree | 87e14ac729928d7e1c54e7a975b365714c50bf85 /drivers/gpio | |
parent | 25553ff0756c59b617af6bdd280c94e943164184 (diff) |
gpiolib: Add comments explaining the _cansleep() WARN_ON()s
I've seen users getting very confused by the WARN_ON()s for can_sleep
GPIOs in the atomic-safe paths, the discoverability of the non-atomic
version of the API seems to be hampered by the fact that it's defined
in a header file not the .c file where the warnings are.
Add a couple of comments next to the warnings to help people on their
way.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Reviwed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpiolib.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 58f40dfc5265..5a75510d66bb 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -1581,6 +1581,7 @@ int __gpio_get_value(unsigned gpio) | |||
1581 | int value; | 1581 | int value; |
1582 | 1582 | ||
1583 | chip = gpio_to_chip(gpio); | 1583 | chip = gpio_to_chip(gpio); |
1584 | /* Should be using gpio_get_value_cansleep() */ | ||
1584 | WARN_ON(chip->can_sleep); | 1585 | WARN_ON(chip->can_sleep); |
1585 | value = chip->get ? chip->get(chip, gpio - chip->base) : 0; | 1586 | value = chip->get ? chip->get(chip, gpio - chip->base) : 0; |
1586 | trace_gpio_value(gpio, 1, value); | 1587 | trace_gpio_value(gpio, 1, value); |
@@ -1653,6 +1654,7 @@ void __gpio_set_value(unsigned gpio, int value) | |||
1653 | struct gpio_chip *chip; | 1654 | struct gpio_chip *chip; |
1654 | 1655 | ||
1655 | chip = gpio_to_chip(gpio); | 1656 | chip = gpio_to_chip(gpio); |
1657 | /* Should be using gpio_set_value_cansleep() */ | ||
1656 | WARN_ON(chip->can_sleep); | 1658 | WARN_ON(chip->can_sleep); |
1657 | trace_gpio_value(gpio, 0, value); | 1659 | trace_gpio_value(gpio, 0, value); |
1658 | if (test_bit(FLAG_OPEN_DRAIN, &gpio_desc[gpio].flags)) | 1660 | if (test_bit(FLAG_OPEN_DRAIN, &gpio_desc[gpio].flags)) |