linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: swarren@nvidia.com (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] ASoC: jack_add_gpios: Don't gpio_request GPIOs used as IRQs.
Date: Thu,  4 Aug 2011 17:00:20 -0600	[thread overview]
Message-ID: <1312498820-2275-4-git-send-email-swarren@nvidia.com> (raw)
In-Reply-To: <1312498820-2275-1-git-send-email-swarren@nvidia.com>

request_any_context_irq now performs this internally. Remove the exra
calls from the driver so that request_any_context_irq succeeds.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 sound/soc/soc-jack.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index 7c17b98..306d521 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -310,14 +310,6 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
 			goto undo;
 		}
 
-		ret = gpio_request(gpios[i].gpio, gpios[i].name);
-		if (ret)
-			goto undo;
-
-		ret = gpio_direction_input(gpios[i].gpio);
-		if (ret)
-			goto err;
-
 		INIT_DELAYED_WORK(&gpios[i].work, gpio_work);
 		gpios[i].jack = jack;
 
@@ -328,7 +320,7 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
 					      gpios[i].name,
 					      &gpios[i]);
 		if (ret)
-			goto err;
+			goto undo;
 
 		if (gpios[i].wake) {
 			ret = irq_set_irq_wake(gpio_to_irq(gpios[i].gpio), 1);
@@ -349,8 +341,6 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
 
 	return 0;
 
-err:
-	gpio_free(gpios[i].gpio);
 undo:
 	snd_soc_jack_free_gpios(jack, i, gpios);
 
@@ -378,7 +368,6 @@ void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
 #endif
 		free_irq(gpio_to_irq(gpios[i].gpio), &gpios[i]);
 		cancel_delayed_work_sync(&gpios[i].work);
-		gpio_free(gpios[i].gpio);
 		gpios[i].jack = NULL;
 	}
 }
-- 
1.7.0.4

  parent reply	other threads:[~2011-08-04 23:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-04 23:00 [RFC PATCH 0/3] If an IRQ is a GPIO, request and configure it Stephen Warren
2011-08-04 23:00 ` [PATCH 1/3] irq: " Stephen Warren
2011-08-05  0:01   ` Mark Brown
2011-08-05  3:53     ` Stephen Warren
2011-08-05  5:35       ` Mark Brown
2011-08-05  8:06         ` Ben Dooks
2011-08-05  8:29           ` Mark Brown
2011-08-05 15:29         ` Stephen Warren
2011-08-05 16:15           ` Mark Brown
2011-08-05  1:54   ` Rob Herring
2011-08-05  4:05     ` Stephen Warren
2011-08-05  7:58   ` Ben Dooks
2011-09-02  8:36   ` Thomas Gleixner
2011-09-02 15:24     ` Stephen Warren
2011-09-02 15:34       ` Stephen Warren
2011-09-02 15:50       ` Thomas Gleixner
2011-08-04 23:00 ` [PATCH 2/3] mmc: tegra: Don't gpio_request GPIOs used as IRQs Stephen Warren
2011-08-04 23:00 ` Stephen Warren [this message]
2011-08-05  7:55 ` [RFC PATCH 0/3] If an IRQ is a GPIO, request and configure it Ben Dooks
2011-08-05  9:40 ` Russell King - ARM Linux
2011-08-05 10:30   ` Ben Dooks
2011-08-05 20:25     ` Linus Walleij
2011-08-05 15:43   ` Stephen Warren
2011-08-05 19:15     ` Russell King - ARM Linux
2011-08-05 19:33       ` Stephen Warren
2011-08-05 21:40         ` Russell King - ARM Linux

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=1312498820-2275-4-git-send-email-swarren@nvidia.com \
    --to=swarren@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).