ASoC: Provide a dummy wrapper of snd_soc_set_dmi_name()
Subsystems (3)
PATCH 1/2 ASoC: Provide a dummy wrapper of snd_soc_set_dmi_name()
For systems without DMI, it makes no sense to have the code.
--- include/sound/soc.h | 8 ++++++++ sound/soc/soc-core.c | 2 ++ 2 files changed, 10 insertions(+)
include/sound/soc.h +8 -0
@@ -497,7 +497,15 @@ void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream);int snd_soc_runtime_set_dai_fmt (struct snd_soc_pcm_runtime *rtd,unsigned int dai_fmt); +#ifdef CONFIG_DMI int snd_soc_set_dmi_name (struct snd_soc_card *card,const char *flavour); +#else +static inline int snd_soc_set_dmi_name (struct snd_soc_card *card, +const char *flavour) +{ +return 0 ; +} +#endif /* Utility functions to get clock rates from various things */ int snd_soc_calc_frame_size (int sample_size,int channels,int tdm_slots);
sound/soc/soc-core.c +2 -0
@@ -1918,6 +1918,7 @@ int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd,EXPORT_SYMBOL_GPL (snd_soc_runtime_set_dai_fmt); +#ifdef CONFIG_DMI /* Trim special characters, and replace '-' with '_' since '-' is used to * separate different DMI fields in the card long name. Only number and * alphabet characters and a few separator characters are kept.
@@ -2049,6 +2050,7 @@ int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour) return 0; }EXPORT_SYMBOL_GPL (snd_soc_set_dmi_name); +#endif /* CONFIG_DMI */ static int snd_soc_instantiate_card (struct snd_soc_card *card) {
Signature · 1 line
2.11.1
PATCH 2/2 ASoC: Call snd_soc_set_dmi_name() unconditionally
Since recently UCM can pick up a configuration specific to the board via card longname field, and we introduced a helper function snd_soc_set_dmi_name() for that. So far, it was used only in one place (sound/soc/intel/boards/broadwell.c), but it should be more widely applied.
This patch puts a big hammer for that: it lets snd_soc_register_card() calling snd_soc_set_dmi_name() unconditionally, so that all x86 devices get the better longname string. This would have no impact for other systems without DMI support, as snd_soc_set_dmi_name() is no-op on them.
--- sound/soc/intel/boards/broadwell.c | 3 --- sound/soc/soc-core.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-)
sound/soc/intel/boards/broadwell.c +0 -3
@@ -269,9 +269,6 @@ static struct snd_soc_card broadwell_rt286 = {static int broadwell_audio_probe (struct platform_device *pdev) { broadwell_rt286.dev = &pdev->dev; - -snd_soc_set_dmi_name (&broadwell_rt286,NULL ); -return devm_snd_soc_register_card (&pdev->dev, &broadwell_rt286); }
sound/soc/soc-core.c +3 -0
@@ -2192,6 +2192,9 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)snd_soc_dapm_add_routes (&card->dapm, card->of_dapm_routes, card->num_of_dapm_routes); +/* try to set some sane longname if DMI is available */ +snd_soc_set_dmi_name (card); +snprintf (card->snd_card->shortname,sizeof (card->snd_card->shortname),"%s" , card->name); snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
Signature · 1 line
2.11.1
kbuild test robot
build botRe: [PATCH 2/2] ASoC: Call snd_soc_set_dmi_name() unconditionally
reproduce:
Hi Takashi,
[auto build test ERROR on asoc/for-next]
[also build test ERROR on v4.11-rc7 next-20170421]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Takashi-Iwai/ASoC-Provide-a-dummy-wrapper-of-snd_soc_set_dmi_name/20170422-122651 base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next config: x86_64-acpi-redef (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=x86_64
All errors (new ones prefixed by >>):
sound/soc/soc-core.c: In function 'snd_soc_instantiate_card':
>> sound/soc/soc-core.c:2191:2: error: too few arguments to function 'snd_soc_set_dmi_name'
snd_soc_set_dmi_name(card);
^~~~~~~~~~~~~~~~~~~~ sound/soc/soc-core.c:1967:5: note: declared here
int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour)
^~~~~~~~~~~~~~~~~~~~
vim +/snd_soc_set_dmi_name +2191 sound/soc/soc-core.c
2185
2186 if (card->of_dapm_routes)
2187 snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes,
2188 card->num_of_dapm_routes);
2189
2190 /* try to set some sane longname if DMI is available */
> 2191 snd_soc_set_dmi_name(card);
2192
2193 snprintf(card->snd_card->shortname, sizeof(card->snd_card->shortname),
2194 "%s", card->name);
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Re: [PATCH 2/2] ASoC: Call snd_soc_set_dmi_name() unconditionally
In reply to Takashi IwaiQuoted 37 lines · Takashi Iwai
Since recently UCM can pick up a configuration specific to the board via card longname field, and we introduced a helper function
snd_soc_set_dmi_name()for that. So far, it was used only in one place (sound/soc/intel/boards/broadwell.c), but it should be more widely applied.This patch puts a big hammer for that: it lets
snd_soc_register_card()callingsnd_soc_set_dmi_name()unconditionally, so that all x86 devices get the better longname string. This would have no impact for other systems without DMI support, assnd_soc_set_dmi_name()is no-op on them.Signed-off-by Takashi Iwai <[email protected]>--- sound/soc/intel/boards/broadwell.c | 3 --- sound/soc/soc-core.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-)sound/soc/intel/boards/broadwell.c +0
-3@@ -269,9 +269,6 @@ static struct snd_soc_card broadwell_rt286 = {static int broadwell_audio_probe (struct platform_device *pdev) { broadwell_rt286.dev = &pdev->dev; - -snd_soc_set_dmi_name (&broadwell_rt286,NULL ); -return devm_snd_soc_register_card (&pdev->dev, &broadwell_rt286); }sound/soc/soc-core.c +0
-0
sound/soc/soc-core.c static int snd_soc_instantiate_card(struct snd_soc_card *card) · line 2196
Quoted 5 lines
sound/soc/soc-core.c +2
-0@@ -2192,6 +2192,9 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)snd_soc_dapm_add_routes (&card->dapm, card->of_dapm_routes, card->num_of_dapm_routes); +/* try to set some sane longname if DMI is available */ +snd_soc_set_dmi_name (card);
This is missing NULL as second arg.
Signature · 1 line
~Vinod
Re: [PATCH 2/2] ASoC: Call snd_soc_set_dmi_name() unconditionally
Quoted 42 lines · Vinod Koul
Quoted 40 lines · Takashi Iwai
Since recently UCM can pick up a configuration specific to the board via card longname field, and we introduced a helper function
snd_soc_set_dmi_name()for that. So far, it was used only in one place (sound/soc/intel/boards/broadwell.c), but it should be more widely applied.This patch puts a big hammer for that: it lets
snd_soc_register_card()callingsnd_soc_set_dmi_name()unconditionally, so that all x86 devices get the better longname string. This would have no impact for other systems without DMI support, assnd_soc_set_dmi_name()is no-op on them.Signed-off-by Takashi Iwai <[email protected]>--- sound/soc/intel/boards/broadwell.c | 3 --- sound/soc/soc-core.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-)sound/soc/intel/boards/broadwell.c +0
-3@@ -269,9 +269,6 @@ static struct snd_soc_card broadwell_rt286 = {static int broadwell_audio_probe (struct platform_device *pdev) { broadwell_rt286.dev = &pdev->dev; - -snd_soc_set_dmi_name (&broadwell_rt286,NULL ); -return devm_snd_soc_register_card (&pdev->dev, &broadwell_rt286); }sound/soc/soc-core.c +0
-0@@ -2192,6 +2192,9 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)snd_soc_dapm_add_routes (&card->dapm, card->of_dapm_routes, card->num_of_dapm_routes);
Quoted 4 lines
sound/soc/soc-core.c static int snd_soc_instantiate_card(struct snd_soc_card *card) · line 2196
Quoted 2 lines
sound/soc/soc-core.c +2
-0+/* try to set some sane longname if DMI is available */ +snd_soc_set_dmi_name (card);This is missing NULL as second arg.
Sorry, I thought I compile-tested, but apparently not. Will refresh and resubmit.
Takashi
Quoted 4 lines · Takashi Iwai
For systems without DMI, it makes no sense to have the code.
Signed-off-by Takashi Iwai <[email protected]>---
Both :-
Quoted 44 lines
include/sound/soc.h | 8 ++++++++ sound/soc/soc-core.c | 2 ++ 2 files changed, 10 insertions(+)include/sound/soc.h +8
-0@@ -497,7 +497,15 @@ void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream);int snd_soc_runtime_set_dai_fmt (struct snd_soc_pcm_runtime *rtd,unsigned int dai_fmt); +#ifdef CONFIG_DMI int snd_soc_set_dmi_name (struct snd_soc_card *card,const char *flavour); +#else +static inline int snd_soc_set_dmi_name (struct snd_soc_card *card, +const char *flavour) +{ +return 0 ; +} +#endif /* Utility functions to get clock rates from various things */ int snd_soc_calc_frame_size (int sample_size,int channels,int tdm_slots);sound/soc/soc-core.c +2
-0@@ -1918,6 +1918,7 @@ int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd,EXPORT_SYMBOL_GPL (snd_soc_runtime_set_dai_fmt); +#ifdef CONFIG_DMI /* Trim special characters, and replace '-' with '_' since '-' is used to * separate different DMI fields in the card long name. Only number and * alphabet characters and a few separator characters are kept. @@ -2049,6 +2050,7 @@ int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour) return 0; }EXPORT_SYMBOL_GPL (snd_soc_set_dmi_name); +#endif /* CONFIG_DMI */ static int snd_soc_instantiate_card (struct snd_soc_card *card) {
Mark Brown
maintainerApplied "ASoC: Provide a dummy wrapper of snd_soc_set_dmi_name()" to the asoc tree
In reply to Takashi IwaiThe patch
ASoC: Provide a dummy wrapper of snd_soc_set_dmi_name()
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
1f5a4535db41bd2bb8d1a15f098cb2921d6c1317Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Mon, 24 Apr 2017 08:54:41 +0200
Subject: [PATCH] ASoC: Provide a dummy wrapper of snd_soc_set_dmi_name()
For systems without DMI, it makes no sense to have the code.
--- include/sound/soc.h | 8 ++++++++ sound/soc/soc-core.c | 2 ++ 2 files changed, 10 insertions(+)
include/sound/soc.h +8 -0
@@ -497,7 +497,15 @@ void snd_soc_runtime_deactivate(struct snd_soc_pcm_runtime *rtd, int stream);int snd_soc_runtime_set_dai_fmt (struct snd_soc_pcm_runtime *rtd,unsigned int dai_fmt); +#ifdef CONFIG_DMI int snd_soc_set_dmi_name (struct snd_soc_card *card,const char *flavour); +#else +static inline int snd_soc_set_dmi_name (struct snd_soc_card *card, +const char *flavour) +{ +return 0 ; +} +#endif /* Utility functions to get clock rates from various things */ int snd_soc_calc_frame_size (int sample_size,int channels,int tdm_slots);
sound/soc/soc-core.c +2 -0
@@ -1918,6 +1918,7 @@ int snd_soc_runtime_set_dai_fmt(struct snd_soc_pcm_runtime *rtd,EXPORT_SYMBOL_GPL (snd_soc_runtime_set_dai_fmt); +#ifdef CONFIG_DMI /* Trim special characters, and replace '-' with '_' since '-' is used to * separate different DMI fields in the card long name. Only number and * alphabet characters and a few separator characters are kept.
@@ -2049,6 +2050,7 @@ int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour) return 0; }EXPORT_SYMBOL_GPL (snd_soc_set_dmi_name); +#endif /* CONFIG_DMI */ static int snd_soc_instantiate_card (struct snd_soc_card *card) {
Signature · 1 line
2.11.0