diff mbox

ASoC: fix snd_soc_jack_add_gpiods stub

Message ID 7602265.lTCp4nNe4p@wuerfel (mailing list archive)
State New, archived
Headers show

Commit Message

Arnd Bergmann May 27, 2014, 3:46 p.m. UTC
f025d3b9c64e1 ("ASoC: jack: Add support for GPIO descriptor defined jack
pins") added this new interface, but the stub function provided for
non-gpiolib builds was defined in the header file as a global function,
leading to lots of "multiple definition of `snd_soc_jack_add_gpiods'"
warnings.

This adds the obvious "static inline" annotation.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>

Comments

Mark Brown May 27, 2014, 3:50 p.m. UTC | #1
On Tue, May 27, 2014 at 05:46:05PM +0200, Arnd Bergmann wrote:
> f025d3b9c64e1 ("ASoC: jack: Add support for GPIO descriptor defined jack
> pins") added this new interface, but the stub function provided for
> non-gpiolib builds was defined in the header file as a global function,
> leading to lots of "multiple definition of `snd_soc_jack_add_gpiods'"
> warnings.

I've already applied a fix for this from Jarkko.
Arnd Bergmann May 27, 2014, 3:52 p.m. UTC | #2
On Tuesday 27 May 2014 16:50:44 Mark Brown wrote:
> On Tue, May 27, 2014 at 05:46:05PM +0200, Arnd Bergmann wrote:
> > f025d3b9c64e1 ("ASoC: jack: Add support for GPIO descriptor defined jack
> > pins") added this new interface, but the stub function provided for
> > non-gpiolib builds was defined in the header file as a global function,
> > leading to lots of "multiple definition of `snd_soc_jack_add_gpiods'"
> > warnings.
> 
> I've already applied a fix for this from Jarkko.

Ok, cool. I should probably at some point subscribe to alsa-devel
so I can check better if someone posted a patch for a bug I find.
I did a google search but didn't find anything on this.

	Arnd
diff mbox

Patch

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 98dca42..559dc53 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -464,9 +464,9 @@  static inline int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
 	return 0;
 }
 
-int snd_soc_jack_add_gpiods(struct device *gpiod_dev,
-			    struct snd_soc_jack *jack,
-			    int count, struct snd_soc_jack_gpio *gpios)
+static inline int snd_soc_jack_add_gpiods(struct device *gpiod_dev,
+					  struct snd_soc_jack *jack,
+					  int count, struct snd_soc_jack_gpio *gpios)
 {
 	return 0;
 }