All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@sirena.org.uk>
To: "Lopez Cruz, Misael" <x0052729@ti.com>
Cc: Takashi Iwai <tiwai@suse.de>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: [PATCH] ASoC: Add GPIO support for jack reporting	interface
Date: Tue, 3 Mar 2009 18:42:57 +0000	[thread overview]
Message-ID: <20090303184257.GJ27155@sirena.org.uk> (raw)
In-Reply-To: <2C7D3DF36ADFFC479B44490D912B616705ECD6DB74@dlee07.ent.ti.com>

On Tue, Mar 03, 2009 at 12:39:17PM -0600, Lopez Cruz, Misael wrote:

> > I prefer GPIO stuff built in conditionally.
> > The jack layer is used also for non-ASoC codes, and GPIO 
> > isn't always present.

> Is it ok if I enclose all gpio functionality with #ifdef CONFIG_GPIOLIB?

Yes, that's fine.

> > This error path doesn't look good.  It seems leaking / 
> > keeping some resources.

> Changed to:

> int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
>                         struct snd_soc_jack_gpio *gpios)
> {
> 	int i, ret;
> 
> 	for (i = 0; i < count; i++) {
> 		if (!gpio_is_valid(gpios[i].gpio)) {
> 			printk(KERN_ERR "Invalid gpio %d\n",
> 					gpios[i].gpio);
> 			return -EINVAL;
> 		}

This still leaks GPIOs and interrupts if one of these tests fails on a
GPIO after the first.

  reply	other threads:[~2009-03-03 18:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-03  1:05 [PATCH] ASoC: Add GPIO support for jack reporting interface Lopez Cruz, Misael
2009-03-03  6:41 ` Takashi Iwai
2009-03-03 11:16   ` Mark Brown
2009-03-03 11:23     ` Takashi Iwai
2009-03-03 18:39   ` Lopez Cruz, Misael
2009-03-03 18:42     ` Mark Brown [this message]
2009-03-03 18:54       ` Lopez Cruz, Misael
2009-03-03 11:14 ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2009-03-03 21:25 Lopez Cruz, Misael
2009-03-04 14:43 ` Mark Brown
2009-03-04 14:52   ` Mark Brown

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=20090303184257.GJ27155@sirena.org.uk \
    --to=broonie@sirena.org.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    --cc=x0052729@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.