diff mbox

ASoC: DAPM: fix snd_soc_dapm_new_control() implicit declaration

Message ID 1433195873-29889-1-git-send-email-vz@mleia.com (mailing list archive)
State Accepted
Commit 5353f65b859255a07e8bf5c096be4d5d268b46e8
Headers show

Commit Message

Vladimir Zapolskiy June 1, 2015, 9:57 p.m. UTC
The change fixes the following compilation problem:

  sound/soc/soc-dapm.c: In function 'dapm_kcontrol_data_alloc':
  sound/soc/soc-dapm.c:388:4: error: implicit declaration of function
    'snd_soc_dapm_new_control' [-Werror=implicit-function-declaration]
    data->widget = snd_soc_dapm_new_control(widget->dapm,
    ^

  sound/soc/soc-dapm.c:387:17: warning: assignment makes pointer
    from integer without a cast [enabled by default]
    data->widget = snd_soc_dapm_new_control(widget->dapm,
                 ^
  sound/soc/soc-dapm.c: At top level:
  sound/soc/soc-dapm.c:3269:1: error: conflicting types for
    'snd_soc_dapm_new_control'
  snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
  ^

In addition to the fix add static qualifier to
snd_soc_dapm_new_control() function to silence checkpatch.

Fixes: 02aa78abec ("ASoC: DAPM: Add APIs to create individual DAPM controls.")
Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
 sound/soc/soc-dapm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Mark Brown June 2, 2015, 5:18 p.m. UTC | #1
On Tue, Jun 02, 2015 at 12:57:53AM +0300, Vladimir Zapolskiy wrote:
> The change fixes the following compilation problem:

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 78d96e1..0d800ac 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -52,6 +52,11 @@  static int snd_soc_dapm_add_path(struct snd_soc_dapm_context *dapm,
 	const char *control,
 	int (*connected)(struct snd_soc_dapm_widget *source,
 			 struct snd_soc_dapm_widget *sink));
+
+static struct snd_soc_dapm_widget *
+snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
+			 const struct snd_soc_dapm_widget *widget);
+
 struct snd_soc_dapm_widget *
 snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
 			 const struct snd_soc_dapm_widget *widget);
@@ -3265,7 +3270,7 @@  int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol,
 }
 EXPORT_SYMBOL_GPL(snd_soc_dapm_put_pin_switch);
 
-struct snd_soc_dapm_widget *
+static struct snd_soc_dapm_widget *
 snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
 	const struct snd_soc_dapm_widget *widget)
 {