[alsa-devel] [PATCH 0/7] ASoC: Samsung: Fix build errors and warnings
This series attempts to fix several build errors and warnings that came up while building for deifferent Samsung defconfigs. Some of these could possibly be applied to stable kernels as well (like patch 2 & 6). This series is based on latest linux-next and is build tested on various Samsung configs.
Sachin Kamat (7): ASoC: Samsung: Fix build regressions due to gpio re-org ASoC: Samsung: s3c-i2s-v2: Fix build error ASoC: Samsung: h1940_uda1380: Remove unused variable ASoC: Samsung: h1940_uda1380: Fix build warning ASoC: Samsung: rx1950_uda1380: Remove unused variable ASoC: Samsung: smdk_wm8994: Fix build error ASoC: Samsung: smdk_wm8994: Fix unused variable warning
sound/soc/samsung/h1940_uda1380.c | 4 ++-- sound/soc/samsung/neo1973_wm8753.c | 1 + sound/soc/samsung/rx1950_uda1380.c | 2 +- sound/soc/samsung/s3c-i2s-v2.c | 6 +++--- sound/soc/samsung/s3c2412-i2s.c | 2 ++ sound/soc/samsung/s3c24xx-i2s.c | 2 ++ sound/soc/samsung/smartq_wm8987.c | 1 + sound/soc/samsung/smdk_wm8994.c | 12 ++++++------ 8 files changed, 18 insertions(+), 12 deletions(-)
Recent changes through commits c67d0f29262b ("ARM: s3c24xx: get rid of custom <mach/gpio.h>"), b0161caa72b6 ("ARM: S3C[24|64]xx: move includes back under <mach/> scope"), 364374121b78 ("ARM: s3c24xx: explicit dependency on <plat/gpio-cfg.h>") and 41c3548e6da6 ("ARM: s3c64xx: get rid of custom <mach/gpio.h>") caused build regressions due to broken dependencies. Fix the following errors by including the necessary header files explicitly:
sound/soc/samsung/h1940_uda1380.c:56:3: error: implicit declaration of function ‘S3C2410_GPG’ sound/soc/samsung/h1940_uda1380.c:149:18: error: ‘S3C_GPIO_END’ undeclared (first use in this function) sound/soc/samsung/h1940_uda1380.c:234:21: error: ‘S3C_GPIO_END’ undeclared (first use in this function) sound/soc/samsung/h1940_uda1380.c:270:12: error: ‘S3C_GPIO_END’ undeclared (first use in this function) sound/soc/samsung/neo1973_wm8753.c:239:2: error: implicit declaration of function ‘S3C2410_GPJ’ sound/soc/samsung/rx1950_uda1380.c:67:3: error: implicit declaration of function ‘S3C2410_GPG’ sound/soc/samsung/s3c2412-i2s.c:86:2: error: implicit declaration of function ‘s3c_gpio_cfgall_range’ sound/soc/samsung/s3c2412-i2s.c:86:2: error: implicit declaration of function ‘S3C2410_GPE’ sound/soc/samsung/s3c2412-i2s.c:86:2: error: implicit declaration of function ‘S3C_GPIO_SFN’ sound/soc/samsung/s3c2412-i2s.c:87:10: error: ‘S3C_GPIO_PULL_NONE’ undeclared sound/soc/samsung/s3c24xx-i2s.c:394:2: error: implicit declaration of function ‘s3c_gpio_cfgall_range’ sound/soc/samsung/s3c24xx-i2s.c:394:2: error: implicit declaration of function ‘S3C2410_GPE’ sound/soc/samsung/s3c24xx-i2s.c:394:2: error: implicit declaration of function ‘S3C_GPIO_SFN’ sound/soc/samsung/s3c24xx-i2s.c:395:10: error: ‘S3C_GPIO_PULL_NONE’ undeclared sound/soc/samsung/smartq_wm8987.c:112:3: error: implicit declaration of function ‘S3C64XX_GPL’
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org Cc: Linus Walleij linus.walleij@linaro.org --- sound/soc/samsung/h1940_uda1380.c | 1 + sound/soc/samsung/neo1973_wm8753.c | 1 + sound/soc/samsung/rx1950_uda1380.c | 1 + sound/soc/samsung/s3c2412-i2s.c | 2 ++ sound/soc/samsung/s3c24xx-i2s.c | 2 ++ sound/soc/samsung/smartq_wm8987.c | 1 + 6 files changed, 8 insertions(+)
diff --git a/sound/soc/samsung/h1940_uda1380.c b/sound/soc/samsung/h1940_uda1380.c index fa91376e323d..fbced589d077 100644 --- a/sound/soc/samsung/h1940_uda1380.c +++ b/sound/soc/samsung/h1940_uda1380.c @@ -23,6 +23,7 @@ #include "regs-iis.h" #include <asm/mach-types.h>
+#include <mach/gpio-samsung.h> #include "s3c24xx-i2s.h"
static unsigned int rates[] = { diff --git a/sound/soc/samsung/neo1973_wm8753.c b/sound/soc/samsung/neo1973_wm8753.c index 807db417d234..98a04c11202d 100644 --- a/sound/soc/samsung/neo1973_wm8753.c +++ b/sound/soc/samsung/neo1973_wm8753.c @@ -20,6 +20,7 @@
#include <sound/soc.h>
+#include <mach/gpio-samsung.h> #include <asm/mach-types.h> #include "regs-iis.h"
diff --git a/sound/soc/samsung/rx1950_uda1380.c b/sound/soc/samsung/rx1950_uda1380.c index 704460a37005..06ebdc061770 100644 --- a/sound/soc/samsung/rx1950_uda1380.c +++ b/sound/soc/samsung/rx1950_uda1380.c @@ -24,6 +24,7 @@ #include <sound/soc.h> #include <sound/jack.h>
+#include <mach/gpio-samsung.h> #include "regs-iis.h" #include <asm/mach-types.h>
diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c index ea885cb9f76c..d0794458963a 100644 --- a/sound/soc/samsung/s3c2412-i2s.c +++ b/sound/soc/samsung/s3c2412-i2s.c @@ -26,6 +26,8 @@ #include <sound/pcm_params.h>
#include <mach/dma.h> +#include <mach/gpio-samsung.h> +#include <plat/gpio-cfg.h>
#include "dma.h" #include "regs-i2s-v2.h" diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c index 9c8ebd872fac..f31e916dd8c4 100644 --- a/sound/soc/samsung/s3c24xx-i2s.c +++ b/sound/soc/samsung/s3c24xx-i2s.c @@ -24,6 +24,8 @@ #include <sound/pcm_params.h>
#include <mach/dma.h> +#include <mach/gpio-samsung.h> +#include <plat/gpio-cfg.h> #include "regs-iis.h"
#include "dma.h" diff --git a/sound/soc/samsung/smartq_wm8987.c b/sound/soc/samsung/smartq_wm8987.c index 58ae3237ef69..c3b2adafb7b5 100644 --- a/sound/soc/samsung/smartq_wm8987.c +++ b/sound/soc/samsung/smartq_wm8987.c @@ -19,6 +19,7 @@ #include <sound/soc.h> #include <sound/jack.h>
+#include <mach/gpio-samsung.h> #include <asm/mach-types.h>
#include "i2s.h"
On Wed, Jan 22, 2014 at 7:13 AM, Sachin Kamat sachin.kamat@linaro.org wrote:
Recent changes through commits c67d0f29262b ("ARM: s3c24xx: get rid of custom <mach/gpio.h>"), b0161caa72b6 ("ARM: S3C[24|64]xx: move includes back under <mach/> scope"), 364374121b78 ("ARM: s3c24xx: explicit dependency on <plat/gpio-cfg.h>") and 41c3548e6da6 ("ARM: s3c64xx: get rid of custom <mach/gpio.h>") caused build regressions due to broken dependencies. Fix the following errors by including the necessary header files explicitly:
sound/soc/samsung/h1940_uda1380.c:56:3: error: implicit declaration of function ‘S3C2410_GPG’ sound/soc/samsung/h1940_uda1380.c:149:18: error: ‘S3C_GPIO_END’ undeclared (first use in this function) sound/soc/samsung/h1940_uda1380.c:234:21: error: ‘S3C_GPIO_END’ undeclared (first use in this function) sound/soc/samsung/h1940_uda1380.c:270:12: error: ‘S3C_GPIO_END’ undeclared (first use in this function) sound/soc/samsung/neo1973_wm8753.c:239:2: error: implicit declaration of function ‘S3C2410_GPJ’ sound/soc/samsung/rx1950_uda1380.c:67:3: error: implicit declaration of function ‘S3C2410_GPG’ sound/soc/samsung/s3c2412-i2s.c:86:2: error: implicit declaration of function ‘s3c_gpio_cfgall_range’ sound/soc/samsung/s3c2412-i2s.c:86:2: error: implicit declaration of function ‘S3C2410_GPE’ sound/soc/samsung/s3c2412-i2s.c:86:2: error: implicit declaration of function ‘S3C_GPIO_SFN’ sound/soc/samsung/s3c2412-i2s.c:87:10: error: ‘S3C_GPIO_PULL_NONE’ undeclared sound/soc/samsung/s3c24xx-i2s.c:394:2: error: implicit declaration of function ‘s3c_gpio_cfgall_range’ sound/soc/samsung/s3c24xx-i2s.c:394:2: error: implicit declaration of function ‘S3C2410_GPE’ sound/soc/samsung/s3c24xx-i2s.c:394:2: error: implicit declaration of function ‘S3C_GPIO_SFN’ sound/soc/samsung/s3c24xx-i2s.c:395:10: error: ‘S3C_GPIO_PULL_NONE’ undeclared sound/soc/samsung/smartq_wm8987.c:112:3: error: implicit declaration of function ‘S3C64XX_GPL’
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org Cc: Linus Walleij linus.walleij@linaro.org
Acked-by: Linus Walleij linus.walleij@linaro.org
And I *really* tried to catch all these, could we make this driver part of the defconfig if it isn't?
Yours, Linus Walleij
On 22 January 2014 13:26, Linus Walleij linus.walleij@linaro.org wrote:
On Wed, Jan 22, 2014 at 7:13 AM, Sachin Kamat sachin.kamat@linaro.org wrote:
Recent changes through commits c67d0f29262b ("ARM: s3c24xx: get rid of custom <mach/gpio.h>"), b0161caa72b6 ("ARM: S3C[24|64]xx: move includes back under <mach/> scope"), 364374121b78 ("ARM: s3c24xx: explicit dependency on <plat/gpio-cfg.h>") and 41c3548e6da6 ("ARM: s3c64xx: get rid of custom <mach/gpio.h>") caused build regressions due to broken dependencies. Fix the following errors by including the necessary header files explicitly:
sound/soc/samsung/h1940_uda1380.c:56:3: error: implicit declaration of function ‘S3C2410_GPG’ sound/soc/samsung/h1940_uda1380.c:149:18: error: ‘S3C_GPIO_END’ undeclared (first use in this function) sound/soc/samsung/h1940_uda1380.c:234:21: error: ‘S3C_GPIO_END’ undeclared (first use in this function) sound/soc/samsung/h1940_uda1380.c:270:12: error: ‘S3C_GPIO_END’ undeclared (first use in this function) sound/soc/samsung/neo1973_wm8753.c:239:2: error: implicit declaration of function ‘S3C2410_GPJ’ sound/soc/samsung/rx1950_uda1380.c:67:3: error: implicit declaration of function ‘S3C2410_GPG’ sound/soc/samsung/s3c2412-i2s.c:86:2: error: implicit declaration of function ‘s3c_gpio_cfgall_range’ sound/soc/samsung/s3c2412-i2s.c:86:2: error: implicit declaration of function ‘S3C2410_GPE’ sound/soc/samsung/s3c2412-i2s.c:86:2: error: implicit declaration of function ‘S3C_GPIO_SFN’ sound/soc/samsung/s3c2412-i2s.c:87:10: error: ‘S3C_GPIO_PULL_NONE’ undeclared sound/soc/samsung/s3c24xx-i2s.c:394:2: error: implicit declaration of function ‘s3c_gpio_cfgall_range’ sound/soc/samsung/s3c24xx-i2s.c:394:2: error: implicit declaration of function ‘S3C2410_GPE’ sound/soc/samsung/s3c24xx-i2s.c:394:2: error: implicit declaration of function ‘S3C_GPIO_SFN’ sound/soc/samsung/s3c24xx-i2s.c:395:10: error: ‘S3C_GPIO_PULL_NONE’ undeclared sound/soc/samsung/smartq_wm8987.c:112:3: error: implicit declaration of function ‘S3C64XX_GPL’
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org Cc: Linus Walleij linus.walleij@linaro.org
Acked-by: Linus Walleij linus.walleij@linaro.org
And I *really* tried to catch all these, could we make this driver part of the defconfig if it isn't?
They aren't enabled by default. But makes sense to have them enabled for better compile coverage.
On Wed, Jan 22, 2014 at 01:40:06PM +0530, Sachin Kamat wrote:
On 22 January 2014 13:26, Linus Walleij linus.walleij@linaro.org wrote:
sound/soc/samsung/smartq_wm8987.c:112:3: error: implicit declaration of function ‘S3C64XX_GPL’
And I *really* tried to catch all these, could we make this driver part of the defconfig if it isn't?
They aren't enabled by default. But makes sense to have them enabled for better compile coverage.
Given that they mostly have so few users it doesn't seem to fit with what a defconfig is supposed to do - allXconfig is usually the way one gets coverage (yes, it's a bit slow but build times seem to be increasing faster than kernel size these days).
Fixes the following error introduced by commit eca3b01d0885 ("ASoC: switch over to use snd_soc_register_component() on s3c i2s"): sound/soc/samsung/s3c-i2s-v2.c:732:32: error: ‘drv’ undeclared (first use in this function)
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org Cc: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/samsung/s3c-i2s-v2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/samsung/s3c-i2s-v2.c b/sound/soc/samsung/s3c-i2s-v2.c index fefc56100349..79e7efb9283c 100644 --- a/sound/soc/samsung/s3c-i2s-v2.c +++ b/sound/soc/samsung/s3c-i2s-v2.c @@ -729,7 +729,7 @@ int s3c_i2sv2_register_component(struct device *dev, int id, struct snd_soc_component_driver *cmp_drv, struct snd_soc_dai_driver *dai_drv) { - struct snd_soc_dai_ops *ops = drv->ops; + struct snd_soc_dai_ops *ops = dai_drv->ops;
ops->trigger = s3c2412_i2s_trigger; if (!ops->hw_params) @@ -742,8 +742,8 @@ int s3c_i2sv2_register_component(struct device *dev, int id, if (!ops->delay) ops->delay = s3c2412_i2s_delay;
- drv->suspend = s3c2412_i2s_suspend; - drv->resume = s3c2412_i2s_resume; + dai_drv->suspend = s3c2412_i2s_suspend; + dai_drv->resume = s3c2412_i2s_resume;
return snd_soc_register_component(dev, cmp_drv, dai_drv, 1); }
Fixes the following warning: sound/soc/samsung/h1940_uda1380.c:183:6: warning: unused variable ‘err’ [-Wunused-variable]
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org --- sound/soc/samsung/h1940_uda1380.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/sound/soc/samsung/h1940_uda1380.c b/sound/soc/samsung/h1940_uda1380.c index fbced589d077..3b27cd96570b 100644 --- a/sound/soc/samsung/h1940_uda1380.c +++ b/sound/soc/samsung/h1940_uda1380.c @@ -181,7 +181,6 @@ static int h1940_uda1380_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_codec *codec = rtd->codec; struct snd_soc_dapm_context *dapm = &codec->dapm; - int err;
snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); snd_soc_dapm_enable_pin(dapm, "Speaker");
Fixes the following warning: sound/soc/samsung/h1940_uda1380.c:98:4: warning: passing argument 1 of ‘dev_err’ from incompatible pointer type [enabled by default]
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org --- sound/soc/samsung/h1940_uda1380.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/samsung/h1940_uda1380.c b/sound/soc/samsung/h1940_uda1380.c index 3b27cd96570b..0003b661ab62 100644 --- a/sound/soc/samsung/h1940_uda1380.c +++ b/sound/soc/samsung/h1940_uda1380.c @@ -94,7 +94,7 @@ static int h1940_hw_params(struct snd_pcm_substream *substream, div++; break; default: - dev_err(&rtd->dev, "%s: rate %d is not supported\n", + dev_err(rtd->dev, "%s: rate %d is not supported\n", __func__, rate); return -EINVAL; }
Fixes the following warning: sound/soc/samsung/rx1950_uda1380.c:228:6: warning: unused variable ‘err’ [-Wunused-variable]
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org --- sound/soc/samsung/rx1950_uda1380.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/sound/soc/samsung/rx1950_uda1380.c b/sound/soc/samsung/rx1950_uda1380.c index 06ebdc061770..afbfe4aa2cbf 100644 --- a/sound/soc/samsung/rx1950_uda1380.c +++ b/sound/soc/samsung/rx1950_uda1380.c @@ -226,7 +226,6 @@ static int rx1950_uda1380_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_codec *codec = rtd->codec; struct snd_soc_dapm_context *dapm = &codec->dapm; - int err;
snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); snd_soc_dapm_enable_pin(dapm, "Speaker");
Fixes the following build error when OF is not defined: sound/soc/samsung/smdk_wm8994.c:191:23: error: ‘samsung_wm8994_of_match’ undeclared (first use in this function)
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org --- sound/soc/samsung/smdk_wm8994.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c index b072bd107b31..1d9641cc172a 100644 --- a/sound/soc/samsung/smdk_wm8994.c +++ b/sound/soc/samsung/smdk_wm8994.c @@ -188,7 +188,7 @@ static int smdk_audio_probe(struct platform_device *pdev) smdk_dai[0].platform_of_node = smdk_dai[0].cpu_of_node; }
- id = of_match_device(samsung_wm8994_of_match, &pdev->dev); + id = of_match_device(of_match_ptr(samsung_wm8994_of_match), &pdev->dev); if (id) *board = *((struct smdk_wm8994_data *)id->data);
At Wed, 22 Jan 2014 11:43:32 +0530, Sachin Kamat wrote:
Fixes the following build error when OF is not defined: sound/soc/samsung/smdk_wm8994.c:191:23: error: ‘samsung_wm8994_of_match’ undeclared (first use in this function)
We can just remove the #ifdef CONFIG_OF, instead? The compiler should be clever enough to drop the actually unused static variables after optimization.
Takashi
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org
sound/soc/samsung/smdk_wm8994.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c index b072bd107b31..1d9641cc172a 100644 --- a/sound/soc/samsung/smdk_wm8994.c +++ b/sound/soc/samsung/smdk_wm8994.c @@ -188,7 +188,7 @@ static int smdk_audio_probe(struct platform_device *pdev) smdk_dai[0].platform_of_node = smdk_dai[0].cpu_of_node; }
- id = of_match_device(samsung_wm8994_of_match, &pdev->dev);
- id = of_match_device(of_match_ptr(samsung_wm8994_of_match), &pdev->dev); if (id) *board = *((struct smdk_wm8994_data *)id->data);
-- 1.7.9.5
On Wed, Jan 22, 2014 at 07:57:16AM +0100, Takashi Iwai wrote:
At Wed, 22 Jan 2014 11:43:32 +0530, Sachin Kamat wrote:
Fixes the following build error when OF is not defined: sound/soc/samsung/smdk_wm8994.c:191:23: error: ‘samsung_wm8994_of_match’ undeclared (first use in this function)
We can just remove the #ifdef CONFIG_OF, instead? The compiler should be clever enough to drop the actually unused static variables after optimization.
Yes, that's a nicer solution.
‘smdk_board_data’ is required only when OF is enabled. Move it to avoid the following build warning: sound/soc/samsung/smdk_wm8994.c:47:32: warning: ‘smdk_board_data’ defined but not used [-Wunused-variable]
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org --- sound/soc/samsung/smdk_wm8994.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c index 1d9641cc172a..a0268fc0a3d9 100644 --- a/sound/soc/samsung/smdk_wm8994.c +++ b/sound/soc/samsung/smdk_wm8994.c @@ -43,11 +43,6 @@ struct smdk_wm8994_data { int mclk1_rate; };
-/* Default SMDKs */ -static struct smdk_wm8994_data smdk_board_data = { - .mclk1_rate = SMDK_WM8994_FREQ, -}; - static int smdk_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { @@ -153,6 +148,11 @@ static struct snd_soc_card smdk = { };
#ifdef CONFIG_OF +/* Default SMDKs */ +static struct smdk_wm8994_data smdk_board_data = { + .mclk1_rate = SMDK_WM8994_FREQ, +}; + static const struct of_device_id samsung_wm8994_of_match[] = { { .compatible = "samsung,smdk-wm8994", .data = &smdk_board_data }, {},
participants (4)
-
Linus Walleij
-
Mark Brown
-
Sachin Kamat
-
Takashi Iwai