public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pritesh Raithatha <praithatha@nvidia.com>
To: <cbouatmailru@gmail.com>, <axel.lin@gmail.com>, <lars@metafoo.de>,
	<cabarnes@indesign-llc.com>
Cc: <linux-kernel@vger.kernel.org>, <praithatha@nvidia.com>
Subject: [PATCH] gpio-charger: use cansleep version of gpio_set_value
Date: Tue, 22 May 2012 14:20:04 +0530	[thread overview]
Message-ID: <1337676604-22836-1-git-send-email-praithatha@nvidia.com> (raw)

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>
---
 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 8672c91..cb2aa31 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:
-- 
1.7.1


             reply	other threads:[~2012-05-22  8:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-22  8:50 Pritesh Raithatha [this message]
2012-05-22 10:30 ` [PATCH] gpio-charger: use cansleep version of gpio_set_value Lars-Peter Clausen
2012-06-20  3:49   ` Anton Vorontsov

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=1337676604-22836-1-git-send-email-praithatha@nvidia.com \
    --to=praithatha@nvidia.com \
    --cc=axel.lin@gmail.com \
    --cc=cabarnes@indesign-llc.com \
    --cc=cbouatmailru@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.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