Skip to content

Commit

Permalink
gpio-charger: Use cansleep version of gpio_set_value
Browse files Browse the repository at this point in the history
Context of gpio_charger_get_property is sleepable so we should
use gpio_set_value_cansleep instead of gpio_set_value.

It will remove WARN_ON incase of using gpio from i2c-to-gpio
expander like pca953x.

Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
  • Loading branch information
Pritesh Raithatha authored and Anton Vorontsov committed Jun 20, 2012
1 parent 9903e62 commit ecb7a8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/gpio-charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static int gpio_charger_get_property(struct power_supply *psy,

switch (psp) {
case POWER_SUPPLY_PROP_ONLINE:
val->intval = gpio_get_value(pdata->gpio);
val->intval = gpio_get_value_cansleep(pdata->gpio);
val->intval ^= pdata->gpio_active_low;
break;
default:
Expand Down

0 comments on commit ecb7a8e

Please sign in to comment.