diff options
author | Heiko Stuebner <heiko.stuebner@bq.com> | 2014-09-23 16:42:16 -0400 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2014-09-24 19:45:59 -0400 |
commit | 4d96fb1ec81118c6406fe6d3670f172b2faaedf3 (patch) | |
tree | 3bb8e9af8313f7cc298a9b3da66dc03fd1ece568 /drivers/power | |
parent | ddd26dff757d08d4eb309a28bf2a02372387e71f (diff) |
power: gpio-charger: do not use gpio value directly
Some gpio implementations return interesting values for gpio_get_value when
the value is not 0 - as seen on a imx6sl board. Therefore do not use the
value returned from gpio_get_value directly but simply check for 0 or not 0.
Signed-off-by: Heiko Stuebner <heiko.stuebner@bq.com>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/gpio-charger.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/gpio-charger.c b/drivers/power/gpio-charger.c index a0024b252197..7536933d0ab9 100644 --- a/drivers/power/gpio-charger.c +++ b/drivers/power/gpio-charger.c | |||
@@ -55,7 +55,7 @@ static int gpio_charger_get_property(struct power_supply *psy, | |||
55 | 55 | ||
56 | switch (psp) { | 56 | switch (psp) { |
57 | case POWER_SUPPLY_PROP_ONLINE: | 57 | case POWER_SUPPLY_PROP_ONLINE: |
58 | val->intval = gpio_get_value_cansleep(pdata->gpio); | 58 | val->intval = !!gpio_get_value_cansleep(pdata->gpio); |
59 | val->intval ^= pdata->gpio_active_low; | 59 | val->intval ^= pdata->gpio_active_low; |
60 | break; | 60 | break; |
61 | default: | 61 | default: |