Re: [PATCH] ASoC: Add GPIO support for jack reporting interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux