diff options
author | Pritesh Raithatha <praithatha@nvidia.com> | 2011-09-27 15:23:13 +0530 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2011-10-05 00:29:38 -0700 |
commit | 16293e2d92b99a81b45c2283bba020e25ec3a694 (patch) | |
tree | ac00ef31ab0d6702aef9224345ee356dc419b377 /drivers | |
parent | cc052568a43356030d98ca6c8aad1f1e6752e8fc (diff) |
power: gpio-charger: correct error condition for request_*_irq
-Correct error condition for request_any_context_irq. It will
remove warnings.
-Use cansleep version of gpio_get_value.
Bug 872590
Change-Id: Ic5c9aaa8a867a9c8381fad457c8a972f99b64df0
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-on: http://git-master/r/54662
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/power/gpio-charger.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/power/gpio-charger.c b/drivers/power/gpio-charger.c index 25b88ac1d44c..cb1901d77c6d 100644 --- a/drivers/power/gpio-charger.c +++ b/drivers/power/gpio-charger.c @@ -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: @@ -127,7 +127,7 @@ static int __devinit gpio_charger_probe(struct platform_device *pdev) ret = request_any_context_irq(irq, gpio_charger_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, dev_name(&pdev->dev), charger); - if (ret) + if (ret < 0) dev_warn(&pdev->dev, "Failed to request irq: %d\n", ret); else gpio_charger->irq = irq; |