[alsa-devel] [PATCH v2 00/15][resend] ASoC: soc-core cleanup step6
Hi Mark
These are resend of v2 of soc-core cleanup step6. These doesn't add new features.
Kuninori Morimoto (15): ASoC: soc-core: remove dai_link_list ASoC: soc-core: remove snd_soc_disconnect_sync() ASoC: soc-core: remove snd_soc_get_dai_substream() ASoC: soc-core: move snd_soc_get_pcm_runtime() ASoC: soc-core: find rtd via dai_link pointer at snd_soc_get_pcm_runtime() ASoC: soc-core: move snd_soc_find_dai_link() ASoC: soc-core: rename snd_soc_add_dai_link() to snd_soc_add_pcm_runtime() ASoC: soc-core: rename snd_soc_remove_dai_link() to snd_soc_remove_pcm_runtime() ASoC: soc-core: move soc_link_dai_pcm_new() ASoC: soc-core: rename soc_link_dai_pcm_new() to soc_dai_pcm_new() ASoC: soc-core: move soc_link_init() ASoC: soc-core: add missing return value check for soc_link_init() ASoC: soc-core: rename soc_link_init() to soc_init_pcm_runtime() ASoC: soc-core: soc_set_name_prefix(): tidyup loop condition ASoC: soc-core: soc_set_name_prefix(): get component device_node at out of loop
include/sound/soc.h | 22 +-- sound/soc/fsl/fsl-asoc-card.c | 2 +- sound/soc/pxa/mioa701_wm9713.c | 2 +- sound/soc/samsung/bells.c | 12 +- sound/soc/samsung/littlemill.c | 10 +- sound/soc/samsung/snow.c | 2 +- sound/soc/samsung/speyside.c | 4 +- sound/soc/samsung/tm2_wm5110.c | 6 +- sound/soc/samsung/tobermory.c | 6 +- sound/soc/sh/rcar/core.c | 2 - sound/soc/soc-core.c | 339 ++++++++++++++++------------------------- sound/soc/soc-topology.c | 47 +++++- sound/soc/tegra/tegra_wm8903.c | 2 +- 13 files changed, 204 insertions(+), 252 deletions(-)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
ASoC is using many lists. Now, used dai_link is listed to card as dai_link_list.
[card]->[dai_link]->[dai_link]->...
BTW, this "dai_link" is used to create "rtd". And this rtd is listed to card as rtd_list.
[card]->[rtd]->[rtd]->...
Here, each rtd has dai_link. This means, we can track all dai_link via rtd list. This patch removes card dai_link_list, and uses rtd_list instead of it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- include/sound/soc.h | 7 ------- sound/soc/soc-core.c | 17 +++++++---------- 2 files changed, 7 insertions(+), 17 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h index c28a1ed..b7ba3b9 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -852,7 +852,6 @@ struct snd_soc_dai_link { /* Do not create a PCM for this DAI link (Backend link) */ unsigned int ignore:1;
- struct list_head list; /* DAI link list of the soc card */ #ifdef CONFIG_SND_SOC_TOPOLOGY struct snd_soc_dobj dobj; /* For topology */ #endif @@ -1037,7 +1036,6 @@ struct snd_soc_card { /* CPU <--> Codec DAI links */ struct snd_soc_dai_link *dai_link; /* predefined links only */ int num_links; /* predefined links only */ - struct list_head dai_link_list; /* all links */
struct list_head rtd_list; int num_rtd; @@ -1107,11 +1105,6 @@ struct snd_soc_card { ((i) < (card)->num_aux_devs) && ((aux) = &(card)->aux_dev[i]); \ (i)++)
-#define for_each_card_links(card, link) \ - list_for_each_entry(link, &(card)->dai_link_list, list) -#define for_each_card_links_safe(card, link, _link) \ - list_for_each_entry_safe(link, _link, &(card)->dai_link_list, list) - #define for_each_card_rtds(card, rtd) \ list_for_each_entry(rtd, &(card)->rtd_list, list) #define for_each_card_rtds_safe(card, rtd, _rtd) \ diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 062653a..435a365 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -934,11 +934,14 @@ struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card, int id, const char *name, const char *stream_name) { + struct snd_soc_pcm_runtime *rtd; struct snd_soc_dai_link *link;
lockdep_assert_held(&client_mutex);
- for_each_card_links(card, link) { + for_each_card_rtds(card, rtd) { + link = rtd->dai_link; + if (link->id != id) continue;
@@ -1075,8 +1078,6 @@ void snd_soc_remove_dai_link(struct snd_soc_card *card, if (card->remove_dai_link) card->remove_dai_link(card, dai_link);
- list_del(&dai_link->list); - rtd = snd_soc_get_pcm_runtime(card, dai_link->name); if (rtd) soc_free_pcm_runtime(rtd); @@ -1158,9 +1159,6 @@ int snd_soc_add_dai_link(struct snd_soc_card *card, } }
- /* see for_each_card_links */ - list_add_tail(&dai_link->list, &card->dai_link_list); - return 0;
_err_defer: @@ -1931,7 +1929,7 @@ static void __soc_setup_card_name(char *name, int len, static void soc_cleanup_card_resources(struct snd_soc_card *card, int card_probed) { - struct snd_soc_dai_link *link, *_link; + struct snd_soc_pcm_runtime *rtd, *n;
if (card->snd_card) snd_card_disconnect_sync(card->snd_card); @@ -1942,8 +1940,8 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card, soc_remove_link_dais(card); soc_remove_link_components(card);
- for_each_card_links_safe(card, link, _link) - snd_soc_remove_dai_link(card, link); + for_each_card_rtds_safe(card, rtd, n) + snd_soc_remove_dai_link(card, rtd->dai_link);
/* remove auxiliary devices */ soc_remove_aux_devices(card); @@ -2393,7 +2391,6 @@ int snd_soc_register_card(struct snd_soc_card *card) INIT_LIST_HEAD(&card->aux_comp_list); INIT_LIST_HEAD(&card->component_dev_list); INIT_LIST_HEAD(&card->list); - INIT_LIST_HEAD(&card->dai_link_list); INIT_LIST_HEAD(&card->rtd_list); INIT_LIST_HEAD(&card->dapm_dirty); INIT_LIST_HEAD(&card->dobj_list);
The patch
ASoC: soc-core: remove dai_link_list
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
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
From cc73390008c9a47c49ad73c459b5590fd4c4c890 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 10 Dec 2019 09:33:40 +0900 Subject: [PATCH] ASoC: soc-core: remove dai_link_list
ASoC is using many lists. Now, used dai_link is listed to card as dai_link_list.
[card]->[dai_link]->[dai_link]->...
BTW, this "dai_link" is used to create "rtd". And this rtd is listed to card as rtd_list.
[card]->[rtd]->[rtd]->...
Here, each rtd has dai_link. This means, we can track all dai_link via rtd list. This patch removes card dai_link_list, and uses rtd_list instead of it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/87fthtyq6z.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- include/sound/soc.h | 7 ------- sound/soc/soc-core.c | 17 +++++++---------- 2 files changed, 7 insertions(+), 17 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h index c28a1ed5e8df..b7ba3b91d080 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -852,7 +852,6 @@ struct snd_soc_dai_link { /* Do not create a PCM for this DAI link (Backend link) */ unsigned int ignore:1;
- struct list_head list; /* DAI link list of the soc card */ #ifdef CONFIG_SND_SOC_TOPOLOGY struct snd_soc_dobj dobj; /* For topology */ #endif @@ -1037,7 +1036,6 @@ struct snd_soc_card { /* CPU <--> Codec DAI links */ struct snd_soc_dai_link *dai_link; /* predefined links only */ int num_links; /* predefined links only */ - struct list_head dai_link_list; /* all links */
struct list_head rtd_list; int num_rtd; @@ -1107,11 +1105,6 @@ struct snd_soc_card { ((i) < (card)->num_aux_devs) && ((aux) = &(card)->aux_dev[i]); \ (i)++)
-#define for_each_card_links(card, link) \ - list_for_each_entry(link, &(card)->dai_link_list, list) -#define for_each_card_links_safe(card, link, _link) \ - list_for_each_entry_safe(link, _link, &(card)->dai_link_list, list) - #define for_each_card_rtds(card, rtd) \ list_for_each_entry(rtd, &(card)->rtd_list, list) #define for_each_card_rtds_safe(card, rtd, _rtd) \ diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 1a362a799dbb..9483bfe17260 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -934,11 +934,14 @@ struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card, int id, const char *name, const char *stream_name) { + struct snd_soc_pcm_runtime *rtd; struct snd_soc_dai_link *link;
lockdep_assert_held(&client_mutex);
- for_each_card_links(card, link) { + for_each_card_rtds(card, rtd) { + link = rtd->dai_link; + if (link->id != id) continue;
@@ -1075,8 +1078,6 @@ void snd_soc_remove_dai_link(struct snd_soc_card *card, if (card->remove_dai_link) card->remove_dai_link(card, dai_link);
- list_del(&dai_link->list); - rtd = snd_soc_get_pcm_runtime(card, dai_link->name); if (rtd) soc_free_pcm_runtime(rtd); @@ -1158,9 +1159,6 @@ int snd_soc_add_dai_link(struct snd_soc_card *card, } }
- /* see for_each_card_links */ - list_add_tail(&dai_link->list, &card->dai_link_list); - return 0;
_err_defer: @@ -1931,7 +1929,7 @@ static void __soc_setup_card_name(char *name, int len, static void soc_cleanup_card_resources(struct snd_soc_card *card, int card_probed) { - struct snd_soc_dai_link *link, *_link; + struct snd_soc_pcm_runtime *rtd, *n;
if (card->snd_card) snd_card_disconnect_sync(card->snd_card); @@ -1942,8 +1940,8 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card, soc_remove_link_dais(card); soc_remove_link_components(card);
- for_each_card_links_safe(card, link, _link) - snd_soc_remove_dai_link(card, link); + for_each_card_rtds_safe(card, rtd, n) + snd_soc_remove_dai_link(card, rtd->dai_link);
/* remove auxiliary devices */ soc_remove_aux_devices(card); @@ -2393,7 +2391,6 @@ int snd_soc_register_card(struct snd_soc_card *card) INIT_LIST_HEAD(&card->aux_comp_list); INIT_LIST_HEAD(&card->component_dev_list); INIT_LIST_HEAD(&card->list); - INIT_LIST_HEAD(&card->dai_link_list); INIT_LIST_HEAD(&card->rtd_list); INIT_LIST_HEAD(&card->dapm_dirty); INIT_LIST_HEAD(&card->dobj_list);
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Sound card disconnecting operation was needed when "sound driver" was unbinded without unbinding "sound card". In such case, sound driver should be stopped even though it was playbacking/capturing. Otherwise clock open/close counter mismatch happen.
One headache was that we can't skip unbind in error case because unbind operation doesn't check return value from each drivers. snd_soc_disconnect_sync() was added for these purpose, and Renesas sound card only is used it.
But now, ALSA SoC automatically disconnect sound card when sound driver was unbinded. Thus, snd_soc_disconnect_sync() is no longer needed. This patch removes it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/sh/rcar/core.c | 2 -- sound/soc/soc-core.c | 12 ------------ 2 files changed, 14 deletions(-)
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index fc32cbb..35a6592 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1808,8 +1808,6 @@ static int rsnd_remove(struct platform_device *pdev) }; int ret = 0, i;
- snd_soc_disconnect_sync(&pdev->dev); - pm_runtime_disable(&pdev->dev);
for_each_rsnd_dai(rdai, priv, i) { diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 435a365..eeddd2c 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1444,18 +1444,6 @@ static int soc_probe_link_components(struct snd_soc_card *card) return 0; }
-void snd_soc_disconnect_sync(struct device *dev) -{ - struct snd_soc_component *component = - snd_soc_lookup_component(dev, NULL); - - if (!component || !component->card) - return; - - snd_card_disconnect_sync(component->card->snd_card); -} -EXPORT_SYMBOL_GPL(snd_soc_disconnect_sync); - static int soc_link_dai_pcm_new(struct snd_soc_dai **dais, int num_dais, struct snd_soc_pcm_runtime *rtd) {
The patch
ASoC: soc-core: remove snd_soc_disconnect_sync()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
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
From b553bd238da23041bf39110e58ee80f8efe034e0 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 10 Dec 2019 09:33:50 +0900 Subject: [PATCH] ASoC: soc-core: remove snd_soc_disconnect_sync()
Sound card disconnecting operation was needed when "sound driver" was unbinded without unbinding "sound card". In such case, sound driver should be stopped even though it was playbacking/capturing. Otherwise clock open/close counter mismatch happen.
One headache was that we can't skip unbind in error case because unbind operation doesn't check return value from each drivers. snd_soc_disconnect_sync() was added for these purpose, and Renesas sound card only is used it.
But now, ALSA SoC automatically disconnect sound card when sound driver was unbinded. Thus, snd_soc_disconnect_sync() is no longer needed. This patch removes it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/87eexdyq6p.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/sh/rcar/core.c | 2 -- sound/soc/soc-core.c | 12 ------------ 2 files changed, 14 deletions(-)
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index d20f03dfdee6..6aac25095218 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1819,8 +1819,6 @@ static int rsnd_remove(struct platform_device *pdev) }; int ret = 0, i;
- snd_soc_disconnect_sync(&pdev->dev); - pm_runtime_disable(&pdev->dev);
for_each_rsnd_dai(rdai, priv, i) { diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 9483bfe17260..0d436a2560e4 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1444,18 +1444,6 @@ static int soc_probe_link_components(struct snd_soc_card *card) return 0; }
-void snd_soc_disconnect_sync(struct device *dev) -{ - struct snd_soc_component *component = - snd_soc_lookup_component(dev, NULL); - - if (!component || !component->card) - return; - - snd_card_disconnect_sync(component->card->snd_card); -} -EXPORT_SYMBOL_GPL(snd_soc_disconnect_sync); - static int soc_link_dai_pcm_new(struct snd_soc_dai **dais, int num_dais, struct snd_soc_pcm_runtime *rtd) {
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
No driver is using snd_soc_get_dai_substream(), and snd_soc_get_pcm_runtime() is enough for such purpose. We can revival it if it was needed in the future. Let's remove unused function.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- include/sound/soc.h | 2 -- sound/soc/soc-core.c | 15 --------------- 2 files changed, 17 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h index b7ba3b9..68ec5a0 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -464,8 +464,6 @@ static inline int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
void snd_soc_disconnect_sync(struct device *dev);
-struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card, - const char *dai_link, int stream); struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card, const char *dai_link);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index eeddd2c..d6118cf 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -389,21 +389,6 @@ struct snd_soc_component *snd_soc_lookup_component(struct device *dev, } EXPORT_SYMBOL_GPL(snd_soc_lookup_component);
-struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card, - const char *dai_link, int stream) -{ - struct snd_soc_pcm_runtime *rtd; - - for_each_card_rtds(card, rtd) { - if (rtd->dai_link->no_pcm && - !strcmp(rtd->dai_link->name, dai_link)) - return rtd->pcm->streams[stream].substream; - } - dev_dbg(card->dev, "ASoC: failed to find dai link %s\n", dai_link); - return NULL; -} -EXPORT_SYMBOL_GPL(snd_soc_get_dai_substream); - static const struct snd_soc_ops null_snd_soc_ops;
static void soc_release_rtd_dev(struct device *dev)
The patch
ASoC: soc-core: remove snd_soc_get_dai_substream()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
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
From 8babfb7030573f7338b141d038c2094b7bb95034 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 10 Dec 2019 09:33:55 +0900 Subject: [PATCH] ASoC: soc-core: remove snd_soc_get_dai_substream()
No driver is using snd_soc_get_dai_substream(), and snd_soc_get_pcm_runtime() is enough for such purpose. We can revival it if it was needed in the future. Let's remove unused function.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/87d0cxyq6k.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- include/sound/soc.h | 2 -- sound/soc/soc-core.c | 15 --------------- 2 files changed, 17 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h index b7ba3b91d080..68ec5a051afe 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -464,8 +464,6 @@ static inline int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
void snd_soc_disconnect_sync(struct device *dev);
-struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card, - const char *dai_link, int stream); struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card, const char *dai_link);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 0d436a2560e4..16265d0e48de 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -389,21 +389,6 @@ struct snd_soc_component *snd_soc_lookup_component(struct device *dev, } EXPORT_SYMBOL_GPL(snd_soc_lookup_component);
-struct snd_pcm_substream *snd_soc_get_dai_substream(struct snd_soc_card *card, - const char *dai_link, int stream) -{ - struct snd_soc_pcm_runtime *rtd; - - for_each_card_rtds(card, rtd) { - if (rtd->dai_link->no_pcm && - !strcmp(rtd->dai_link->name, dai_link)) - return rtd->pcm->streams[stream].substream; - } - dev_dbg(card->dev, "ASoC: failed to find dai link %s\n", dai_link); - return NULL; -} -EXPORT_SYMBOL_GPL(snd_soc_get_dai_substream); - static const struct snd_soc_ops null_snd_soc_ops;
static void soc_release_rtd_dev(struct device *dev)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
This patch moves snd_soc_get_pcm_runtime() next to snd_soc_get_dai_substream(). This is prepare for snd_soc_get_pcm_runtime() cleanup.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/soc-core.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d6118cf..0081b65 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -391,6 +391,21 @@ EXPORT_SYMBOL_GPL(snd_soc_lookup_component);
static const struct snd_soc_ops null_snd_soc_ops;
+struct snd_soc_pcm_runtime +*snd_soc_get_pcm_runtime(struct snd_soc_card *card, + const char *dai_link) +{ + struct snd_soc_pcm_runtime *rtd; + + for_each_card_rtds(card, rtd) { + if (!strcmp(rtd->dai_link->name, dai_link)) + return rtd; + } + dev_dbg(card->dev, "ASoC: failed to find rtd %s\n", dai_link); + return NULL; +} +EXPORT_SYMBOL_GPL(snd_soc_get_pcm_runtime); + static void soc_release_rtd_dev(struct device *dev) { /* "dev" means "rtd->dev" */ @@ -491,20 +506,6 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime( return NULL; }
-struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card, - const char *dai_link) -{ - struct snd_soc_pcm_runtime *rtd; - - for_each_card_rtds(card, rtd) { - if (!strcmp(rtd->dai_link->name, dai_link)) - return rtd; - } - dev_dbg(card->dev, "ASoC: failed to find rtd %s\n", dai_link); - return NULL; -} -EXPORT_SYMBOL_GPL(snd_soc_get_pcm_runtime); - static void snd_soc_flush_all_delayed_work(struct snd_soc_card *card) { struct snd_soc_pcm_runtime *rtd;
The patch
ASoC: soc-core: move snd_soc_get_pcm_runtime()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
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
From 94def8ea66be2ea9f6aac61549b6b5874bca6235 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 10 Dec 2019 09:34:01 +0900 Subject: [PATCH] ASoC: soc-core: move snd_soc_get_pcm_runtime()
This patch moves snd_soc_get_pcm_runtime() next to snd_soc_get_dai_substream(). This is prepare for snd_soc_get_pcm_runtime() cleanup.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/87blshyq6e.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/soc-core.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 16265d0e48de..f215a37fd3d6 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -391,6 +391,21 @@ EXPORT_SYMBOL_GPL(snd_soc_lookup_component);
static const struct snd_soc_ops null_snd_soc_ops;
+struct snd_soc_pcm_runtime +*snd_soc_get_pcm_runtime(struct snd_soc_card *card, + const char *dai_link) +{ + struct snd_soc_pcm_runtime *rtd; + + for_each_card_rtds(card, rtd) { + if (!strcmp(rtd->dai_link->name, dai_link)) + return rtd; + } + dev_dbg(card->dev, "ASoC: failed to find rtd %s\n", dai_link); + return NULL; +} +EXPORT_SYMBOL_GPL(snd_soc_get_pcm_runtime); + static void soc_release_rtd_dev(struct device *dev) { /* "dev" means "rtd->dev" */ @@ -491,20 +506,6 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime( return NULL; }
-struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card, - const char *dai_link) -{ - struct snd_soc_pcm_runtime *rtd; - - for_each_card_rtds(card, rtd) { - if (!strcmp(rtd->dai_link->name, dai_link)) - return rtd; - } - dev_dbg(card->dev, "ASoC: failed to find rtd %s\n", dai_link); - return NULL; -} -EXPORT_SYMBOL_GPL(snd_soc_get_pcm_runtime); - static void snd_soc_flush_all_delayed_work(struct snd_soc_card *card) { struct snd_soc_pcm_runtime *rtd;
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Current snd_soc_get_pcm_runtime() is finding rtd by checking dai_link name. But, it is strange and waste of CPU power, because its user want to get from rtd from dai_link, not from dai_link name. This patch find rtd via dai_link pointer instead of its name.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- include/sound/soc.h | 2 +- sound/soc/fsl/fsl-asoc-card.c | 2 +- sound/soc/pxa/mioa701_wm9713.c | 2 +- sound/soc/samsung/bells.c | 12 ++++++------ sound/soc/samsung/littlemill.c | 10 +++++----- sound/soc/samsung/snow.c | 2 +- sound/soc/samsung/speyside.c | 4 ++-- sound/soc/samsung/tm2_wm5110.c | 6 +++--- sound/soc/samsung/tobermory.c | 6 +++--- sound/soc/soc-core.c | 8 ++++---- sound/soc/tegra/tegra_wm8903.c | 2 +- 11 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h index 68ec5a0..40c2a67 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -465,7 +465,7 @@ static inline int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) void snd_soc_disconnect_sync(struct device *dev);
struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card, - const char *dai_link); + struct snd_soc_dai_link *dai_link);
bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd); void snd_soc_runtime_activate(struct snd_soc_pcm_runtime *rtd, int stream); diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 39ea9bd..9ce55fe 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -256,7 +256,7 @@ static int fsl_asoc_card_set_bias_level(struct snd_soc_card *card, unsigned int pll_out; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); codec_dai = rtd->codec_dai; if (dapm->dev != codec_dai->dev) return 0; diff --git a/sound/soc/pxa/mioa701_wm9713.c b/sound/soc/pxa/mioa701_wm9713.c index 129eb52..76e054d 100644 --- a/sound/soc/pxa/mioa701_wm9713.c +++ b/sound/soc/pxa/mioa701_wm9713.c @@ -72,7 +72,7 @@ static int rear_amp_event(struct snd_soc_dapm_widget *widget, struct snd_soc_pcm_runtime *rtd; struct snd_soc_component *component;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); component = rtd->codec_dai->component; return rear_amp_power(component, SND_SOC_DAPM_EVENT_ON(event)); } diff --git a/sound/soc/samsung/bells.c b/sound/soc/samsung/bells.c index b60b226..58d8a81 100644 --- a/sound/soc/samsung/bells.c +++ b/sound/soc/samsung/bells.c @@ -59,7 +59,7 @@ static int bells_set_bias_level(struct snd_soc_card *card, struct bells_drvdata *bells = card->drvdata; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_DSP_CODEC].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_DSP_CODEC]); codec_dai = rtd->codec_dai; component = codec_dai->component;
@@ -105,7 +105,7 @@ static int bells_set_bias_level_post(struct snd_soc_card *card, struct bells_drvdata *bells = card->drvdata; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_DSP_CODEC].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_DSP_CODEC]); codec_dai = rtd->codec_dai; component = codec_dai->component;
@@ -151,10 +151,10 @@ static int bells_late_probe(struct snd_soc_card *card) struct snd_soc_dai *wm9081_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_AP_DSP].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_AP_DSP]); wm0010 = rtd->codec_dai->component;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_DSP_CODEC].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_DSP_CODEC]); component = rtd->codec_dai->component; aif1_dai = rtd->codec_dai;
@@ -194,7 +194,7 @@ static int bells_late_probe(struct snd_soc_card *card) return ret; }
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_CODEC_CP].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_CODEC_CP]); aif2_dai = rtd->cpu_dai;
ret = snd_soc_dai_set_sysclk(aif2_dai, ARIZONA_CLK_ASYNCCLK, 0, 0); @@ -206,7 +206,7 @@ static int bells_late_probe(struct snd_soc_card *card) if (card->num_rtd == DAI_CODEC_SUB) return 0;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_CODEC_SUB].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_CODEC_SUB]); aif3_dai = rtd->cpu_dai; wm9081_dai = rtd->codec_dai;
diff --git a/sound/soc/samsung/littlemill.c b/sound/soc/samsung/littlemill.c index 6132cee..59904f4 100644 --- a/sound/soc/samsung/littlemill.c +++ b/sound/soc/samsung/littlemill.c @@ -22,7 +22,7 @@ static int littlemill_set_bias_level(struct snd_soc_card *card, struct snd_soc_dai *aif1_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); aif1_dai = rtd->codec_dai;
if (dapm->dev != aif1_dai->dev) @@ -69,7 +69,7 @@ static int littlemill_set_bias_level_post(struct snd_soc_card *card, struct snd_soc_dai *aif1_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); aif1_dai = rtd->codec_dai;
if (dapm->dev != aif1_dai->dev) @@ -180,7 +180,7 @@ static int bbclk_ev(struct snd_soc_dapm_widget *w, struct snd_soc_dai *aif2_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[1].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[1]); aif2_dai = rtd->cpu_dai;
switch (event) { @@ -263,11 +263,11 @@ static int littlemill_late_probe(struct snd_soc_card *card) struct snd_soc_dai *aif2_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); component = rtd->codec_dai->component; aif1_dai = rtd->codec_dai;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[1].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[1]); aif2_dai = rtd->cpu_dai;
ret = snd_soc_dai_set_sysclk(aif1_dai, WM8994_SYSCLK_MCLK2, diff --git a/sound/soc/samsung/snow.c b/sound/soc/samsung/snow.c index 8ea7799..f075aae 100644 --- a/sound/soc/samsung/snow.c +++ b/sound/soc/samsung/snow.c @@ -106,7 +106,7 @@ static int snow_late_probe(struct snd_soc_card *card) struct snd_soc_pcm_runtime *rtd; struct snd_soc_dai *codec_dai;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]);
/* In the multi-codec case codec_dais 0 is MAX98095 and 1 is HDMI. */ if (rtd->num_codecs > 1) diff --git a/sound/soc/samsung/speyside.c b/sound/soc/samsung/speyside.c index 9e58cbe..5ccdfe0 100644 --- a/sound/soc/samsung/speyside.c +++ b/sound/soc/samsung/speyside.c @@ -24,7 +24,7 @@ static int speyside_set_bias_level(struct snd_soc_card *card, struct snd_soc_dai *codec_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[1].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[1]); codec_dai = rtd->codec_dai;
if (dapm->dev != codec_dai->dev) @@ -60,7 +60,7 @@ static int speyside_set_bias_level_post(struct snd_soc_card *card, struct snd_soc_dai *codec_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[1].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[1]); codec_dai = rtd->codec_dai;
if (dapm->dev != codec_dai->dev) diff --git a/sound/soc/samsung/tm2_wm5110.c b/sound/soc/samsung/tm2_wm5110.c index bb9910d..10ff14b8 100644 --- a/sound/soc/samsung/tm2_wm5110.c +++ b/sound/soc/samsung/tm2_wm5110.c @@ -282,7 +282,7 @@ static int tm2_set_bias_level(struct snd_soc_card *card, { struct snd_soc_pcm_runtime *rtd;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]);
if (dapm->dev != rtd->codec_dai->dev) return 0; @@ -314,7 +314,7 @@ static int tm2_late_probe(struct snd_soc_card *card) struct snd_soc_dai *aif2_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[TM2_DAI_AIF1].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[TM2_DAI_AIF1]); aif1_dai = rtd->codec_dai; priv->component = rtd->codec_dai->component;
@@ -324,7 +324,7 @@ static int tm2_late_probe(struct snd_soc_card *card) return ret; }
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[TM2_DAI_AIF2].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[TM2_DAI_AIF2]); aif2_dai = rtd->codec_dai;
ret = snd_soc_dai_set_sysclk(aif2_dai, ARIZONA_CLK_ASYNCCLK, 0, 0); diff --git a/sound/soc/samsung/tobermory.c b/sound/soc/samsung/tobermory.c index ef51f28..fdce28c 100644 --- a/sound/soc/samsung/tobermory.c +++ b/sound/soc/samsung/tobermory.c @@ -22,7 +22,7 @@ static int tobermory_set_bias_level(struct snd_soc_card *card, struct snd_soc_dai *codec_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); codec_dai = rtd->codec_dai;
if (dapm->dev != codec_dai->dev) @@ -65,7 +65,7 @@ static int tobermory_set_bias_level_post(struct snd_soc_card *card, struct snd_soc_dai *codec_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); codec_dai = rtd->codec_dai;
if (dapm->dev != codec_dai->dev) @@ -180,7 +180,7 @@ static int tobermory_late_probe(struct snd_soc_card *card) struct snd_soc_dai *codec_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); component = rtd->codec_dai->component; codec_dai = rtd->codec_dai;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 0081b65..3373615 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -393,15 +393,15 @@ static const struct snd_soc_ops null_snd_soc_ops;
struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card, - const char *dai_link) + struct snd_soc_dai_link *dai_link) { struct snd_soc_pcm_runtime *rtd;
for_each_card_rtds(card, rtd) { - if (!strcmp(rtd->dai_link->name, dai_link)) + if (rtd->dai_link == dai_link) return rtd; } - dev_dbg(card->dev, "ASoC: failed to find rtd %s\n", dai_link); + dev_dbg(card->dev, "ASoC: failed to find rtd %s\n", dai_link->name); return NULL; } EXPORT_SYMBOL_GPL(snd_soc_get_pcm_runtime); @@ -1064,7 +1064,7 @@ void snd_soc_remove_dai_link(struct snd_soc_card *card, if (card->remove_dai_link) card->remove_dai_link(card, dai_link);
- rtd = snd_soc_get_pcm_runtime(card, dai_link->name); + rtd = snd_soc_get_pcm_runtime(card, dai_link); if (rtd) soc_free_pcm_runtime(rtd); } diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c index 6211dfd..f08d348 100644 --- a/sound/soc/tegra/tegra_wm8903.c +++ b/sound/soc/tegra/tegra_wm8903.c @@ -186,7 +186,7 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd) static int tegra_wm8903_remove(struct snd_soc_card *card) { struct snd_soc_pcm_runtime *rtd = - snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + snd_soc_get_pcm_runtime(card, &card->dai_link[0]); struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_component *component = codec_dai->component;
The patch
ASoC: soc-core: find rtd via dai_link pointer at snd_soc_get_pcm_runtime()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
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
From 4468189ff307f294491628a49702a04de22bffb8 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 10 Dec 2019 09:34:08 +0900 Subject: [PATCH] ASoC: soc-core: find rtd via dai_link pointer at snd_soc_get_pcm_runtime()
Current snd_soc_get_pcm_runtime() is finding rtd by checking dai_link name. But, it is strange and waste of CPU power, because its user want to get from rtd from dai_link, not from dai_link name. This patch find rtd via dai_link pointer instead of its name.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/87a781yq67.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- include/sound/soc.h | 2 +- sound/soc/fsl/fsl-asoc-card.c | 2 +- sound/soc/pxa/mioa701_wm9713.c | 2 +- sound/soc/samsung/bells.c | 12 ++++++------ sound/soc/samsung/littlemill.c | 10 +++++----- sound/soc/samsung/snow.c | 2 +- sound/soc/samsung/speyside.c | 4 ++-- sound/soc/samsung/tm2_wm5110.c | 6 +++--- sound/soc/samsung/tobermory.c | 6 +++--- sound/soc/soc-core.c | 8 ++++---- sound/soc/tegra/tegra_wm8903.c | 2 +- 11 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h index 68ec5a051afe..40c2a677f531 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -465,7 +465,7 @@ static inline int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) void snd_soc_disconnect_sync(struct device *dev);
struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card, - const char *dai_link); + struct snd_soc_dai_link *dai_link);
bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd); void snd_soc_runtime_activate(struct snd_soc_pcm_runtime *rtd, int stream); diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 39ea9bda1394..9ce55feaac22 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -256,7 +256,7 @@ static int fsl_asoc_card_set_bias_level(struct snd_soc_card *card, unsigned int pll_out; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); codec_dai = rtd->codec_dai; if (dapm->dev != codec_dai->dev) return 0; diff --git a/sound/soc/pxa/mioa701_wm9713.c b/sound/soc/pxa/mioa701_wm9713.c index 129eb5251a5f..76e054d514a8 100644 --- a/sound/soc/pxa/mioa701_wm9713.c +++ b/sound/soc/pxa/mioa701_wm9713.c @@ -72,7 +72,7 @@ static int rear_amp_event(struct snd_soc_dapm_widget *widget, struct snd_soc_pcm_runtime *rtd; struct snd_soc_component *component;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); component = rtd->codec_dai->component; return rear_amp_power(component, SND_SOC_DAPM_EVENT_ON(event)); } diff --git a/sound/soc/samsung/bells.c b/sound/soc/samsung/bells.c index b60b2268b608..58d8a81aa0ea 100644 --- a/sound/soc/samsung/bells.c +++ b/sound/soc/samsung/bells.c @@ -59,7 +59,7 @@ static int bells_set_bias_level(struct snd_soc_card *card, struct bells_drvdata *bells = card->drvdata; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_DSP_CODEC].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_DSP_CODEC]); codec_dai = rtd->codec_dai; component = codec_dai->component;
@@ -105,7 +105,7 @@ static int bells_set_bias_level_post(struct snd_soc_card *card, struct bells_drvdata *bells = card->drvdata; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_DSP_CODEC].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_DSP_CODEC]); codec_dai = rtd->codec_dai; component = codec_dai->component;
@@ -151,10 +151,10 @@ static int bells_late_probe(struct snd_soc_card *card) struct snd_soc_dai *wm9081_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_AP_DSP].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_AP_DSP]); wm0010 = rtd->codec_dai->component;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_DSP_CODEC].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_DSP_CODEC]); component = rtd->codec_dai->component; aif1_dai = rtd->codec_dai;
@@ -194,7 +194,7 @@ static int bells_late_probe(struct snd_soc_card *card) return ret; }
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_CODEC_CP].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_CODEC_CP]); aif2_dai = rtd->cpu_dai;
ret = snd_soc_dai_set_sysclk(aif2_dai, ARIZONA_CLK_ASYNCCLK, 0, 0); @@ -206,7 +206,7 @@ static int bells_late_probe(struct snd_soc_card *card) if (card->num_rtd == DAI_CODEC_SUB) return 0;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[DAI_CODEC_SUB].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[DAI_CODEC_SUB]); aif3_dai = rtd->cpu_dai; wm9081_dai = rtd->codec_dai;
diff --git a/sound/soc/samsung/littlemill.c b/sound/soc/samsung/littlemill.c index 6132cee8550b..59904f44118b 100644 --- a/sound/soc/samsung/littlemill.c +++ b/sound/soc/samsung/littlemill.c @@ -22,7 +22,7 @@ static int littlemill_set_bias_level(struct snd_soc_card *card, struct snd_soc_dai *aif1_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); aif1_dai = rtd->codec_dai;
if (dapm->dev != aif1_dai->dev) @@ -69,7 +69,7 @@ static int littlemill_set_bias_level_post(struct snd_soc_card *card, struct snd_soc_dai *aif1_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); aif1_dai = rtd->codec_dai;
if (dapm->dev != aif1_dai->dev) @@ -180,7 +180,7 @@ static int bbclk_ev(struct snd_soc_dapm_widget *w, struct snd_soc_dai *aif2_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[1].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[1]); aif2_dai = rtd->cpu_dai;
switch (event) { @@ -263,11 +263,11 @@ static int littlemill_late_probe(struct snd_soc_card *card) struct snd_soc_dai *aif2_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); component = rtd->codec_dai->component; aif1_dai = rtd->codec_dai;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[1].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[1]); aif2_dai = rtd->cpu_dai;
ret = snd_soc_dai_set_sysclk(aif1_dai, WM8994_SYSCLK_MCLK2, diff --git a/sound/soc/samsung/snow.c b/sound/soc/samsung/snow.c index 8ea7799df028..f075aae9561a 100644 --- a/sound/soc/samsung/snow.c +++ b/sound/soc/samsung/snow.c @@ -106,7 +106,7 @@ static int snow_late_probe(struct snd_soc_card *card) struct snd_soc_pcm_runtime *rtd; struct snd_soc_dai *codec_dai;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]);
/* In the multi-codec case codec_dais 0 is MAX98095 and 1 is HDMI. */ if (rtd->num_codecs > 1) diff --git a/sound/soc/samsung/speyside.c b/sound/soc/samsung/speyside.c index 9e58cbed942a..5ccdfe0eb6fe 100644 --- a/sound/soc/samsung/speyside.c +++ b/sound/soc/samsung/speyside.c @@ -24,7 +24,7 @@ static int speyside_set_bias_level(struct snd_soc_card *card, struct snd_soc_dai *codec_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[1].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[1]); codec_dai = rtd->codec_dai;
if (dapm->dev != codec_dai->dev) @@ -60,7 +60,7 @@ static int speyside_set_bias_level_post(struct snd_soc_card *card, struct snd_soc_dai *codec_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[1].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[1]); codec_dai = rtd->codec_dai;
if (dapm->dev != codec_dai->dev) diff --git a/sound/soc/samsung/tm2_wm5110.c b/sound/soc/samsung/tm2_wm5110.c index bb9910d4cbe2..10ff14b856f2 100644 --- a/sound/soc/samsung/tm2_wm5110.c +++ b/sound/soc/samsung/tm2_wm5110.c @@ -282,7 +282,7 @@ static int tm2_set_bias_level(struct snd_soc_card *card, { struct snd_soc_pcm_runtime *rtd;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]);
if (dapm->dev != rtd->codec_dai->dev) return 0; @@ -314,7 +314,7 @@ static int tm2_late_probe(struct snd_soc_card *card) struct snd_soc_dai *aif2_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[TM2_DAI_AIF1].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[TM2_DAI_AIF1]); aif1_dai = rtd->codec_dai; priv->component = rtd->codec_dai->component;
@@ -324,7 +324,7 @@ static int tm2_late_probe(struct snd_soc_card *card) return ret; }
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[TM2_DAI_AIF2].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[TM2_DAI_AIF2]); aif2_dai = rtd->codec_dai;
ret = snd_soc_dai_set_sysclk(aif2_dai, ARIZONA_CLK_ASYNCCLK, 0, 0); diff --git a/sound/soc/samsung/tobermory.c b/sound/soc/samsung/tobermory.c index ef51f289fbc7..fdce28cc26c4 100644 --- a/sound/soc/samsung/tobermory.c +++ b/sound/soc/samsung/tobermory.c @@ -22,7 +22,7 @@ static int tobermory_set_bias_level(struct snd_soc_card *card, struct snd_soc_dai *codec_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); codec_dai = rtd->codec_dai;
if (dapm->dev != codec_dai->dev) @@ -65,7 +65,7 @@ static int tobermory_set_bias_level_post(struct snd_soc_card *card, struct snd_soc_dai *codec_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); codec_dai = rtd->codec_dai;
if (dapm->dev != codec_dai->dev) @@ -180,7 +180,7 @@ static int tobermory_late_probe(struct snd_soc_card *card) struct snd_soc_dai *codec_dai; int ret;
- rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + rtd = snd_soc_get_pcm_runtime(card, &card->dai_link[0]); component = rtd->codec_dai->component; codec_dai = rtd->codec_dai;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index f215a37fd3d6..9ee7d5d118c0 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -393,15 +393,15 @@ static const struct snd_soc_ops null_snd_soc_ops;
struct snd_soc_pcm_runtime *snd_soc_get_pcm_runtime(struct snd_soc_card *card, - const char *dai_link) + struct snd_soc_dai_link *dai_link) { struct snd_soc_pcm_runtime *rtd;
for_each_card_rtds(card, rtd) { - if (!strcmp(rtd->dai_link->name, dai_link)) + if (rtd->dai_link == dai_link) return rtd; } - dev_dbg(card->dev, "ASoC: failed to find rtd %s\n", dai_link); + dev_dbg(card->dev, "ASoC: failed to find rtd %s\n", dai_link->name); return NULL; } EXPORT_SYMBOL_GPL(snd_soc_get_pcm_runtime); @@ -1064,7 +1064,7 @@ void snd_soc_remove_dai_link(struct snd_soc_card *card, if (card->remove_dai_link) card->remove_dai_link(card, dai_link);
- rtd = snd_soc_get_pcm_runtime(card, dai_link->name); + rtd = snd_soc_get_pcm_runtime(card, dai_link); if (rtd) soc_free_pcm_runtime(rtd); } diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c index 6211dfda2195..f08d3489c3cf 100644 --- a/sound/soc/tegra/tegra_wm8903.c +++ b/sound/soc/tegra/tegra_wm8903.c @@ -186,7 +186,7 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd) static int tegra_wm8903_remove(struct snd_soc_card *card) { struct snd_soc_pcm_runtime *rtd = - snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + snd_soc_get_pcm_runtime(card, &card->dai_link[0]); struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_component *component = codec_dai->component;
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
snd_soc_find_dai_link() is soc-topology specific function. We don't need to have it at soc-core. This patch moves it to soc-topology.c
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- include/sound/soc.h | 3 --- sound/soc/soc-core.c | 44 -------------------------------------------- sound/soc/soc-topology.c | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 47 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h index 40c2a67..09d3d9b 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1327,9 +1327,6 @@ int snd_soc_add_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); void snd_soc_remove_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); -struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card, - int id, const char *name, - const char *stream_name);
struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component, struct snd_soc_dai_driver *dai_drv, diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 3373615..3221e776 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -901,50 +901,6 @@ struct snd_soc_dai *snd_soc_find_dai( } EXPORT_SYMBOL_GPL(snd_soc_find_dai);
-/** - * snd_soc_find_dai_link - Find a DAI link - * - * @card: soc card - * @id: DAI link ID to match - * @name: DAI link name to match, optional - * @stream_name: DAI link stream name to match, optional - * - * This function will search all existing DAI links of the soc card to - * find the link of the same ID. Since DAI links may not have their - * unique ID, so name and stream name should also match if being - * specified. - * - * Return: pointer of DAI link, or NULL if not found. - */ -struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card, - int id, const char *name, - const char *stream_name) -{ - struct snd_soc_pcm_runtime *rtd; - struct snd_soc_dai_link *link; - - lockdep_assert_held(&client_mutex); - - for_each_card_rtds(card, rtd) { - link = rtd->dai_link; - - if (link->id != id) - continue; - - if (name && (!link->name || strcmp(name, link->name))) - continue; - - if (stream_name && (!link->stream_name - || strcmp(stream_name, link->stream_name))) - continue; - - return link; - } - - return NULL; -} -EXPORT_SYMBOL_GPL(snd_soc_find_dai_link); - static int soc_dai_link_sanity_check(struct snd_soc_card *card, struct snd_soc_dai_link *link) { diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 81d2af0..cbd605b 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -2207,6 +2207,47 @@ static int link_new_ver(struct soc_tplg *tplg, return 0; }
+/** + * snd_soc_find_dai_link - Find a DAI link + * + * @card: soc card + * @id: DAI link ID to match + * @name: DAI link name to match, optional + * @stream_name: DAI link stream name to match, optional + * + * This function will search all existing DAI links of the soc card to + * find the link of the same ID. Since DAI links may not have their + * unique ID, so name and stream name should also match if being + * specified. + * + * Return: pointer of DAI link, or NULL if not found. + */ +static struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card, + int id, const char *name, + const char *stream_name) +{ + struct snd_soc_pcm_runtime *rtd; + struct snd_soc_dai_link *link; + + for_each_card_rtds(card, rtd) { + link = rtd->dai_link; + + if (link->id != id) + continue; + + if (name && (!link->name || strcmp(name, link->name))) + continue; + + if (stream_name && (!link->stream_name + || strcmp(stream_name, link->stream_name))) + continue; + + return link; + } + + return NULL; +} + /* Find and configure an existing physical DAI link */ static int soc_tplg_link_config(struct soc_tplg *tplg, struct snd_soc_tplg_link_config *cfg)
The patch
ASoC: soc-core: move snd_soc_find_dai_link()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
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
From d6f31e0e6d09594717ed21c7c9238d9fbdb30ccb Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 10 Dec 2019 09:34:14 +0900 Subject: [PATCH] ASoC: soc-core: move snd_soc_find_dai_link()
snd_soc_find_dai_link() is soc-topology specific function. We don't need to have it at soc-core. This patch moves it to soc-topology.c
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/878snlyq61.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- include/sound/soc.h | 3 --- sound/soc/soc-core.c | 44 ---------------------------------------- sound/soc/soc-topology.c | 41 +++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 47 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h index 40c2a677f531..09d3d9b615c2 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1327,9 +1327,6 @@ int snd_soc_add_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); void snd_soc_remove_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); -struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card, - int id, const char *name, - const char *stream_name);
struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component, struct snd_soc_dai_driver *dai_drv, diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 9ee7d5d118c0..bf5bbb1f3cdb 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -901,50 +901,6 @@ struct snd_soc_dai *snd_soc_find_dai( } EXPORT_SYMBOL_GPL(snd_soc_find_dai);
-/** - * snd_soc_find_dai_link - Find a DAI link - * - * @card: soc card - * @id: DAI link ID to match - * @name: DAI link name to match, optional - * @stream_name: DAI link stream name to match, optional - * - * This function will search all existing DAI links of the soc card to - * find the link of the same ID. Since DAI links may not have their - * unique ID, so name and stream name should also match if being - * specified. - * - * Return: pointer of DAI link, or NULL if not found. - */ -struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card, - int id, const char *name, - const char *stream_name) -{ - struct snd_soc_pcm_runtime *rtd; - struct snd_soc_dai_link *link; - - lockdep_assert_held(&client_mutex); - - for_each_card_rtds(card, rtd) { - link = rtd->dai_link; - - if (link->id != id) - continue; - - if (name && (!link->name || strcmp(name, link->name))) - continue; - - if (stream_name && (!link->stream_name - || strcmp(stream_name, link->stream_name))) - continue; - - return link; - } - - return NULL; -} -EXPORT_SYMBOL_GPL(snd_soc_find_dai_link); - static int soc_dai_link_sanity_check(struct snd_soc_card *card, struct snd_soc_dai_link *link) { diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 81d2af000a5c..cbd605b96722 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -2207,6 +2207,47 @@ static int link_new_ver(struct soc_tplg *tplg, return 0; }
+/** + * snd_soc_find_dai_link - Find a DAI link + * + * @card: soc card + * @id: DAI link ID to match + * @name: DAI link name to match, optional + * @stream_name: DAI link stream name to match, optional + * + * This function will search all existing DAI links of the soc card to + * find the link of the same ID. Since DAI links may not have their + * unique ID, so name and stream name should also match if being + * specified. + * + * Return: pointer of DAI link, or NULL if not found. + */ +static struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card, + int id, const char *name, + const char *stream_name) +{ + struct snd_soc_pcm_runtime *rtd; + struct snd_soc_dai_link *link; + + for_each_card_rtds(card, rtd) { + link = rtd->dai_link; + + if (link->id != id) + continue; + + if (name && (!link->name || strcmp(name, link->name))) + continue; + + if (stream_name && (!link->stream_name + || strcmp(stream_name, link->stream_name))) + continue; + + return link; + } + + return NULL; +} + /* Find and configure an existing physical DAI link */ static int soc_tplg_link_config(struct soc_tplg *tplg, struct snd_soc_tplg_link_config *cfg)
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Now soc-core and soc-topology is using snd_soc_add_dai_link(). The abstract of this function is "create pcm_runtime from dai_link information and connect it to card". Thus, "add dai_link" is wrong/confusable naming. This patch renames function name.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- include/sound/soc.h | 4 ++-- sound/soc/soc-core.c | 18 +++++++++--------- sound/soc/soc-topology.c | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h index 09d3d9b..b223b2d 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1323,8 +1323,8 @@ int snd_soc_of_get_dai_link_codecs(struct device *dev, struct snd_soc_dai_link *dai_link); void snd_soc_of_put_dai_link_codecs(struct snd_soc_dai_link *dai_link);
-int snd_soc_add_dai_link(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_link); +int snd_soc_add_pcm_runtime(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_link); void snd_soc_remove_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 3221e776..e1818bf 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1027,18 +1027,18 @@ void snd_soc_remove_dai_link(struct snd_soc_card *card, EXPORT_SYMBOL_GPL(snd_soc_remove_dai_link);
/** - * snd_soc_add_dai_link - Add a DAI link dynamically - * @card: The ASoC card to which the DAI link is added - * @dai_link: The new DAI link to add + * snd_soc_add_pcm_runtime - Add a pcm_runtime dynamically via dai_link + * @card: The ASoC card to which the pcm_runtime is added + * @dai_link: The DAI link to find pcm_runtime * - * This function adds a DAI link to the ASoC card's link list. + * This function adds a pcm_runtime ASoC card by using dai_link. * - * Note: Topology can use this API to add DAI links when probing the + * Note: Topology can use this API to add pcm_runtime when probing the * topology component. And machine drivers can still define static * DAI links in dai_link array. */ -int snd_soc_add_dai_link(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_link) +int snd_soc_add_pcm_runtime(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_link) { struct snd_soc_pcm_runtime *rtd; struct snd_soc_dai_link_component *codec, *platform; @@ -1107,7 +1107,7 @@ int snd_soc_add_dai_link(struct snd_soc_card *card, soc_free_pcm_runtime(rtd); return -EPROBE_DEFER; } -EXPORT_SYMBOL_GPL(snd_soc_add_dai_link); +EXPORT_SYMBOL_GPL(snd_soc_add_pcm_runtime);
static void soc_set_of_name_prefix(struct snd_soc_component *component) { @@ -1929,7 +1929,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card) /* add predefined DAI links to the list */ card->num_rtd = 0; for_each_card_prelinks(card, i, dai_link) { - ret = snd_soc_add_dai_link(card, dai_link); + ret = snd_soc_add_pcm_runtime(card, dai_link); if (ret < 0) goto probe_end; } diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index cbd605b..de42788 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1945,7 +1945,7 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg, link->dobj.type = SND_SOC_DOBJ_DAI_LINK; list_add(&link->dobj.list, &tplg->comp->dobj_list);
- snd_soc_add_dai_link(tplg->comp->card, link); + snd_soc_add_pcm_runtime(tplg->comp->card, link); return 0; }
The patch
ASoC: soc-core: rename snd_soc_add_dai_link() to snd_soc_add_pcm_runtime()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
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
From 0c04800424c42ec3fbe87422d3e04b5c978fc177 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 10 Dec 2019 09:34:19 +0900 Subject: [PATCH] ASoC: soc-core: rename snd_soc_add_dai_link() to snd_soc_add_pcm_runtime()
Now soc-core and soc-topology is using snd_soc_add_dai_link(). The abstract of this function is "create pcm_runtime from dai_link information and connect it to card". Thus, "add dai_link" is wrong/confusable naming. This patch renames function name.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/877e35yq5w.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- include/sound/soc.h | 4 ++-- sound/soc/soc-core.c | 18 +++++++++--------- sound/soc/soc-topology.c | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h index 09d3d9b615c2..b223b2d39950 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1323,8 +1323,8 @@ int snd_soc_of_get_dai_link_codecs(struct device *dev, struct snd_soc_dai_link *dai_link); void snd_soc_of_put_dai_link_codecs(struct snd_soc_dai_link *dai_link);
-int snd_soc_add_dai_link(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_link); +int snd_soc_add_pcm_runtime(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_link); void snd_soc_remove_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index bf5bbb1f3cdb..af9da991d99e 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1027,18 +1027,18 @@ void snd_soc_remove_dai_link(struct snd_soc_card *card, EXPORT_SYMBOL_GPL(snd_soc_remove_dai_link);
/** - * snd_soc_add_dai_link - Add a DAI link dynamically - * @card: The ASoC card to which the DAI link is added - * @dai_link: The new DAI link to add + * snd_soc_add_pcm_runtime - Add a pcm_runtime dynamically via dai_link + * @card: The ASoC card to which the pcm_runtime is added + * @dai_link: The DAI link to find pcm_runtime * - * This function adds a DAI link to the ASoC card's link list. + * This function adds a pcm_runtime ASoC card by using dai_link. * - * Note: Topology can use this API to add DAI links when probing the + * Note: Topology can use this API to add pcm_runtime when probing the * topology component. And machine drivers can still define static * DAI links in dai_link array. */ -int snd_soc_add_dai_link(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_link) +int snd_soc_add_pcm_runtime(struct snd_soc_card *card, + struct snd_soc_dai_link *dai_link) { struct snd_soc_pcm_runtime *rtd; struct snd_soc_dai_link_component *codec, *platform; @@ -1107,7 +1107,7 @@ int snd_soc_add_dai_link(struct snd_soc_card *card, soc_free_pcm_runtime(rtd); return -EPROBE_DEFER; } -EXPORT_SYMBOL_GPL(snd_soc_add_dai_link); +EXPORT_SYMBOL_GPL(snd_soc_add_pcm_runtime);
static void soc_set_of_name_prefix(struct snd_soc_component *component) { @@ -1929,7 +1929,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card) /* add predefined DAI links to the list */ card->num_rtd = 0; for_each_card_prelinks(card, i, dai_link) { - ret = snd_soc_add_dai_link(card, dai_link); + ret = snd_soc_add_pcm_runtime(card, dai_link); if (ret < 0) goto probe_end; } diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index cbd605b96722..de427881a2ae 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1945,7 +1945,7 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg, link->dobj.type = SND_SOC_DOBJ_DAI_LINK; list_add(&link->dobj.list, &tplg->comp->dobj_list);
- snd_soc_add_dai_link(tplg->comp->card, link); + snd_soc_add_pcm_runtime(tplg->comp->card, link); return 0; }
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Now soc-core and soc-topology is using snd_soc_remove_dai_link(). It removes pcm_runtime (= rtd) and disconnect it from card. The purpose is removing pcm_runtime, not dai_link. This patch renames function name.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- include/sound/soc.h | 4 ++-- sound/soc/soc-core.c | 29 +++++++++++------------------ sound/soc/soc-topology.c | 4 +++- 3 files changed, 16 insertions(+), 21 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h index b223b2d..3923178 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1325,8 +1325,8 @@ void snd_soc_of_put_dai_link_codecs(struct snd_soc_dai_link *dai_link);
int snd_soc_add_pcm_runtime(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); -void snd_soc_remove_dai_link(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_link); +void snd_soc_remove_pcm_runtime(struct snd_soc_card *card, + struct snd_soc_pcm_runtime *rtd);
struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component, struct snd_soc_dai_driver *dai_drv, diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index e1818bf..2827073 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -998,33 +998,26 @@ static int soc_dai_link_sanity_check(struct snd_soc_card *card, }
/** - * snd_soc_remove_dai_link - Remove a DAI link from the list - * @card: The ASoC card that owns the link - * @dai_link: The DAI link to remove + * snd_soc_remove_pcm_runtime - Remove a pcm_runtime from card + * @card: The ASoC card to which the pcm_runtime has + * @rtd: The pcm_runtime to remove * - * This function removes a DAI link from the ASoC card's link list. - * - * For DAI links previously added by topology, topology should - * remove them by using the dobj embedded in the link. + * This function removes a pcm_runtime from the ASoC card. */ -void snd_soc_remove_dai_link(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_link) +void snd_soc_remove_pcm_runtime(struct snd_soc_card *card, + struct snd_soc_pcm_runtime *rtd) { - struct snd_soc_pcm_runtime *rtd; - lockdep_assert_held(&client_mutex);
/* * Notify the machine driver for extra destruction */ if (card->remove_dai_link) - card->remove_dai_link(card, dai_link); + card->remove_dai_link(card, rtd->dai_link);
- rtd = snd_soc_get_pcm_runtime(card, dai_link); - if (rtd) - soc_free_pcm_runtime(rtd); + soc_free_pcm_runtime(rtd); } -EXPORT_SYMBOL_GPL(snd_soc_remove_dai_link); +EXPORT_SYMBOL_GPL(snd_soc_remove_pcm_runtime);
/** * snd_soc_add_pcm_runtime - Add a pcm_runtime dynamically via dai_link @@ -1104,7 +1097,7 @@ int snd_soc_add_pcm_runtime(struct snd_soc_card *card, return 0;
_err_defer: - soc_free_pcm_runtime(rtd); + snd_soc_remove_pcm_runtime(card, rtd); return -EPROBE_DEFER; } EXPORT_SYMBOL_GPL(snd_soc_add_pcm_runtime); @@ -1871,7 +1864,7 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card, soc_remove_link_components(card);
for_each_card_rtds_safe(card, rtd, n) - snd_soc_remove_dai_link(card, rtd->dai_link); + snd_soc_remove_pcm_runtime(card, rtd);
/* remove auxiliary devices */ soc_remove_aux_devices(card); diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index de42788..e9b660f 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -553,7 +553,9 @@ static void remove_link(struct snd_soc_component *comp, kfree(link->cpus->dai_name);
list_del(&dobj->list); - snd_soc_remove_dai_link(comp->card, link); + + snd_soc_remove_pcm_runtime(comp->card, + snd_soc_get_pcm_runtime(comp->card, link)); kfree(link); }
The patch
ASoC: soc-core: rename snd_soc_remove_dai_link() to snd_soc_remove_pcm_runtime()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
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
From 50cd9b5317d5593d0a33f4227f56ddcc1bf66604 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 10 Dec 2019 09:34:23 +0900 Subject: [PATCH] ASoC: soc-core: rename snd_soc_remove_dai_link() to snd_soc_remove_pcm_runtime()
Now soc-core and soc-topology is using snd_soc_remove_dai_link(). It removes pcm_runtime (= rtd) and disconnect it from card. The purpose is removing pcm_runtime, not dai_link. This patch renames function name.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/875zipyq5s.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- include/sound/soc.h | 4 ++-- sound/soc/soc-core.c | 29 +++++++++++------------------ sound/soc/soc-topology.c | 4 +++- 3 files changed, 16 insertions(+), 21 deletions(-)
diff --git a/include/sound/soc.h b/include/sound/soc.h index b223b2d39950..3923178ad050 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1325,8 +1325,8 @@ void snd_soc_of_put_dai_link_codecs(struct snd_soc_dai_link *dai_link);
int snd_soc_add_pcm_runtime(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); -void snd_soc_remove_dai_link(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_link); +void snd_soc_remove_pcm_runtime(struct snd_soc_card *card, + struct snd_soc_pcm_runtime *rtd);
struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component, struct snd_soc_dai_driver *dai_drv, diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index af9da991d99e..f82d521306b7 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -998,33 +998,26 @@ static int soc_dai_link_sanity_check(struct snd_soc_card *card, }
/** - * snd_soc_remove_dai_link - Remove a DAI link from the list - * @card: The ASoC card that owns the link - * @dai_link: The DAI link to remove + * snd_soc_remove_pcm_runtime - Remove a pcm_runtime from card + * @card: The ASoC card to which the pcm_runtime has + * @rtd: The pcm_runtime to remove * - * This function removes a DAI link from the ASoC card's link list. - * - * For DAI links previously added by topology, topology should - * remove them by using the dobj embedded in the link. + * This function removes a pcm_runtime from the ASoC card. */ -void snd_soc_remove_dai_link(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_link) +void snd_soc_remove_pcm_runtime(struct snd_soc_card *card, + struct snd_soc_pcm_runtime *rtd) { - struct snd_soc_pcm_runtime *rtd; - lockdep_assert_held(&client_mutex);
/* * Notify the machine driver for extra destruction */ if (card->remove_dai_link) - card->remove_dai_link(card, dai_link); + card->remove_dai_link(card, rtd->dai_link);
- rtd = snd_soc_get_pcm_runtime(card, dai_link); - if (rtd) - soc_free_pcm_runtime(rtd); + soc_free_pcm_runtime(rtd); } -EXPORT_SYMBOL_GPL(snd_soc_remove_dai_link); +EXPORT_SYMBOL_GPL(snd_soc_remove_pcm_runtime);
/** * snd_soc_add_pcm_runtime - Add a pcm_runtime dynamically via dai_link @@ -1104,7 +1097,7 @@ int snd_soc_add_pcm_runtime(struct snd_soc_card *card, return 0;
_err_defer: - soc_free_pcm_runtime(rtd); + snd_soc_remove_pcm_runtime(card, rtd); return -EPROBE_DEFER; } EXPORT_SYMBOL_GPL(snd_soc_add_pcm_runtime); @@ -1871,7 +1864,7 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card, soc_remove_link_components(card);
for_each_card_rtds_safe(card, rtd, n) - snd_soc_remove_dai_link(card, rtd->dai_link); + snd_soc_remove_pcm_runtime(card, rtd);
/* remove auxiliary devices */ soc_remove_aux_devices(card); diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index de427881a2ae..e9b660f3116f 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -553,7 +553,9 @@ static void remove_link(struct snd_soc_component *comp, kfree(link->cpus->dai_name);
list_del(&dobj->list); - snd_soc_remove_dai_link(comp->card, link); + + snd_soc_remove_pcm_runtime(comp->card, + snd_soc_get_pcm_runtime(comp->card, link)); kfree(link); }
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
This patch moves soc_link_dai_pcm_new() to upper side. This is prepare for its cleanup.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/soc-core.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 2827073..ded678f 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1102,6 +1102,27 @@ int snd_soc_add_pcm_runtime(struct snd_soc_card *card, } EXPORT_SYMBOL_GPL(snd_soc_add_pcm_runtime);
+static int soc_link_dai_pcm_new(struct snd_soc_dai **dais, int num_dais, + struct snd_soc_pcm_runtime *rtd) +{ + int i, ret = 0; + + for (i = 0; i < num_dais; ++i) { + struct snd_soc_dai_driver *drv = dais[i]->driver; + + if (drv->pcm_new) + ret = drv->pcm_new(rtd, dais[i]); + if (ret < 0) { + dev_err(dais[i]->dev, + "ASoC: Failed to bind %s with pcm device\n", + dais[i]->name); + return ret; + } + } + + return 0; +} + static void soc_set_of_name_prefix(struct snd_soc_component *component) { struct device_node *of_node = soc_component_to_node(component); @@ -1379,27 +1400,6 @@ static int soc_probe_link_components(struct snd_soc_card *card) return 0; }
-static int soc_link_dai_pcm_new(struct snd_soc_dai **dais, int num_dais, - struct snd_soc_pcm_runtime *rtd) -{ - int i, ret = 0; - - for (i = 0; i < num_dais; ++i) { - struct snd_soc_dai_driver *drv = dais[i]->driver; - - if (drv->pcm_new) - ret = drv->pcm_new(rtd, dais[i]); - if (ret < 0) { - dev_err(dais[i]->dev, - "ASoC: Failed to bind %s with pcm device\n", - dais[i]->name); - return ret; - } - } - - return 0; -} - static int soc_link_init(struct snd_soc_card *card, struct snd_soc_pcm_runtime *rtd) {
The patch
ASoC: soc-core: move soc_link_dai_pcm_new()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
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
From 9e9c70a5dd0194f6a30a04d96dd8c1f6ff44f6c4 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 10 Dec 2019 09:34:27 +0900 Subject: [PATCH] ASoC: soc-core: move soc_link_dai_pcm_new()
This patch moves soc_link_dai_pcm_new() to upper side. This is prepare for its cleanup.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/874ky9yq5o.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/soc-core.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index f82d521306b7..8ace5f5b251c 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1102,6 +1102,27 @@ int snd_soc_add_pcm_runtime(struct snd_soc_card *card, } EXPORT_SYMBOL_GPL(snd_soc_add_pcm_runtime);
+static int soc_link_dai_pcm_new(struct snd_soc_dai **dais, int num_dais, + struct snd_soc_pcm_runtime *rtd) +{ + int i, ret = 0; + + for (i = 0; i < num_dais; ++i) { + struct snd_soc_dai_driver *drv = dais[i]->driver; + + if (drv->pcm_new) + ret = drv->pcm_new(rtd, dais[i]); + if (ret < 0) { + dev_err(dais[i]->dev, + "ASoC: Failed to bind %s with pcm device\n", + dais[i]->name); + return ret; + } + } + + return 0; +} + static void soc_set_of_name_prefix(struct snd_soc_component *component) { struct device_node *of_node = soc_component_to_node(component); @@ -1379,27 +1400,6 @@ static int soc_probe_link_components(struct snd_soc_card *card) return 0; }
-static int soc_link_dai_pcm_new(struct snd_soc_dai **dais, int num_dais, - struct snd_soc_pcm_runtime *rtd) -{ - int i, ret = 0; - - for (i = 0; i < num_dais; ++i) { - struct snd_soc_dai_driver *drv = dais[i]->driver; - - if (drv->pcm_new) - ret = drv->pcm_new(rtd, dais[i]); - if (ret < 0) { - dev_err(dais[i]->dev, - "ASoC: Failed to bind %s with pcm device\n", - dais[i]->name); - return ret; - } - } - - return 0; -} - static int soc_link_init(struct snd_soc_card *card, struct snd_soc_pcm_runtime *rtd) {
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
soc_link_dai_pcm_new() sounds like dai_link function, but it is not related to it. This patch rename soc_link_dai_pcm_new() to soc_dai_pcm_new().
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/soc-core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index ded678f..7278903 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1102,8 +1102,8 @@ int snd_soc_add_pcm_runtime(struct snd_soc_card *card, } EXPORT_SYMBOL_GPL(snd_soc_add_pcm_runtime);
-static int soc_link_dai_pcm_new(struct snd_soc_dai **dais, int num_dais, - struct snd_soc_pcm_runtime *rtd) +static int soc_dai_pcm_new(struct snd_soc_dai **dais, int num_dais, + struct snd_soc_pcm_runtime *rtd) { int i, ret = 0;
@@ -1464,11 +1464,11 @@ static int soc_link_init(struct snd_soc_card *card, dai_link->stream_name, ret); return ret; } - ret = soc_link_dai_pcm_new(&cpu_dai, 1, rtd); + ret = soc_dai_pcm_new(&cpu_dai, 1, rtd); if (ret < 0) return ret; - ret = soc_link_dai_pcm_new(rtd->codec_dais, - rtd->num_codecs, rtd); + ret = soc_dai_pcm_new(rtd->codec_dais, + rtd->num_codecs, rtd); return ret; }
The patch
ASoC: soc-core: rename soc_link_dai_pcm_new() to soc_dai_pcm_new()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
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
From bfa0dd89536026e17b074eb2c42089f3455ea1a3 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 10 Dec 2019 09:34:32 +0900 Subject: [PATCH] ASoC: soc-core: rename soc_link_dai_pcm_new() to soc_dai_pcm_new()
soc_link_dai_pcm_new() sounds like dai_link function, but it is not related to it. This patch rename soc_link_dai_pcm_new() to soc_dai_pcm_new().
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/8736dtyq5j.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/soc-core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 8ace5f5b251c..81164b54632a 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1102,8 +1102,8 @@ int snd_soc_add_pcm_runtime(struct snd_soc_card *card, } EXPORT_SYMBOL_GPL(snd_soc_add_pcm_runtime);
-static int soc_link_dai_pcm_new(struct snd_soc_dai **dais, int num_dais, - struct snd_soc_pcm_runtime *rtd) +static int soc_dai_pcm_new(struct snd_soc_dai **dais, int num_dais, + struct snd_soc_pcm_runtime *rtd) { int i, ret = 0;
@@ -1464,11 +1464,11 @@ static int soc_link_init(struct snd_soc_card *card, dai_link->stream_name, ret); return ret; } - ret = soc_link_dai_pcm_new(&cpu_dai, 1, rtd); + ret = soc_dai_pcm_new(&cpu_dai, 1, rtd); if (ret < 0) return ret; - ret = soc_link_dai_pcm_new(rtd->codec_dais, - rtd->num_codecs, rtd); + ret = soc_dai_pcm_new(rtd->codec_dais, + rtd->num_codecs, rtd); return ret; }
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
This patch moves soc_link_init() to upper side. This is prepare for its cleanup.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/soc-core.c | 144 +++++++++++++++++++++++++-------------------------- 1 file changed, 72 insertions(+), 72 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 7278903..79a4753 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1123,6 +1123,78 @@ static int soc_dai_pcm_new(struct snd_soc_dai **dais, int num_dais, return 0; }
+static int soc_link_init(struct snd_soc_card *card, + struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_dai_link *dai_link = rtd->dai_link; + struct snd_soc_dai *cpu_dai = rtd->cpu_dai; + struct snd_soc_rtdcom_list *rtdcom; + struct snd_soc_component *component; + int ret, num; + + /* set default power off timeout */ + rtd->pmdown_time = pmdown_time; + + /* do machine specific initialization */ + if (dai_link->init) { + ret = dai_link->init(rtd); + if (ret < 0) { + dev_err(card->dev, "ASoC: failed to init %s: %d\n", + dai_link->name, ret); + return ret; + } + } + + if (dai_link->dai_fmt) { + ret = snd_soc_runtime_set_dai_fmt(rtd, dai_link->dai_fmt); + if (ret) + return ret; + } + + /* add DPCM sysfs entries */ + soc_dpcm_debugfs_add(rtd); + + num = rtd->num; + + /* + * most drivers will register their PCMs using DAI link ordering but + * topology based drivers can use the DAI link id field to set PCM + * device number and then use rtd + a base offset of the BEs. + */ + for_each_rtd_components(rtd, rtdcom, component) { + if (!component->driver->use_dai_pcm_id) + continue; + + if (rtd->dai_link->no_pcm) + num += component->driver->be_pcm_base; + else + num = rtd->dai_link->id; + } + + /* create compress_device if possible */ + ret = snd_soc_dai_compress_new(cpu_dai, rtd, num); + if (ret != -ENOTSUPP) { + if (ret < 0) + dev_err(card->dev, "ASoC: can't create compress %s\n", + dai_link->stream_name); + return ret; + } + + /* create the pcm */ + ret = soc_new_pcm(rtd, num); + if (ret < 0) { + dev_err(card->dev, "ASoC: can't create pcm %s :%d\n", + dai_link->stream_name, ret); + return ret; + } + ret = soc_dai_pcm_new(&cpu_dai, 1, rtd); + if (ret < 0) + return ret; + ret = soc_dai_pcm_new(rtd->codec_dais, + rtd->num_codecs, rtd); + return ret; +} + static void soc_set_of_name_prefix(struct snd_soc_component *component) { struct device_node *of_node = soc_component_to_node(component); @@ -1400,78 +1472,6 @@ static int soc_probe_link_components(struct snd_soc_card *card) return 0; }
-static int soc_link_init(struct snd_soc_card *card, - struct snd_soc_pcm_runtime *rtd) -{ - struct snd_soc_dai_link *dai_link = rtd->dai_link; - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; - struct snd_soc_rtdcom_list *rtdcom; - struct snd_soc_component *component; - int ret, num; - - /* set default power off timeout */ - rtd->pmdown_time = pmdown_time; - - /* do machine specific initialization */ - if (dai_link->init) { - ret = dai_link->init(rtd); - if (ret < 0) { - dev_err(card->dev, "ASoC: failed to init %s: %d\n", - dai_link->name, ret); - return ret; - } - } - - if (dai_link->dai_fmt) { - ret = snd_soc_runtime_set_dai_fmt(rtd, dai_link->dai_fmt); - if (ret) - return ret; - } - - /* add DPCM sysfs entries */ - soc_dpcm_debugfs_add(rtd); - - num = rtd->num; - - /* - * most drivers will register their PCMs using DAI link ordering but - * topology based drivers can use the DAI link id field to set PCM - * device number and then use rtd + a base offset of the BEs. - */ - for_each_rtd_components(rtd, rtdcom, component) { - if (!component->driver->use_dai_pcm_id) - continue; - - if (rtd->dai_link->no_pcm) - num += component->driver->be_pcm_base; - else - num = rtd->dai_link->id; - } - - /* create compress_device if possible */ - ret = snd_soc_dai_compress_new(cpu_dai, rtd, num); - if (ret != -ENOTSUPP) { - if (ret < 0) - dev_err(card->dev, "ASoC: can't create compress %s\n", - dai_link->stream_name); - return ret; - } - - /* create the pcm */ - ret = soc_new_pcm(rtd, num); - if (ret < 0) { - dev_err(card->dev, "ASoC: can't create pcm %s :%d\n", - dai_link->stream_name, ret); - return ret; - } - ret = soc_dai_pcm_new(&cpu_dai, 1, rtd); - if (ret < 0) - return ret; - ret = soc_dai_pcm_new(rtd->codec_dais, - rtd->num_codecs, rtd); - return ret; -} - static void soc_unbind_aux_dev(struct snd_soc_card *card) { struct snd_soc_component *component, *_component;
The patch
ASoC: soc-core: move soc_link_init()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
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
From 46496acbe1c43cd26f5515b51b5d3c46a97d785d Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 10 Dec 2019 09:34:36 +0900 Subject: [PATCH] ASoC: soc-core: move soc_link_init()
This patch moves soc_link_init() to upper side. This is prepare for its cleanup.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/871rtdyq5g.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/soc-core.c | 144 +++++++++++++++++++++---------------------- 1 file changed, 72 insertions(+), 72 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 81164b54632a..04cb69072f80 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1123,6 +1123,78 @@ static int soc_dai_pcm_new(struct snd_soc_dai **dais, int num_dais, return 0; }
+static int soc_link_init(struct snd_soc_card *card, + struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_dai_link *dai_link = rtd->dai_link; + struct snd_soc_dai *cpu_dai = rtd->cpu_dai; + struct snd_soc_rtdcom_list *rtdcom; + struct snd_soc_component *component; + int ret, num; + + /* set default power off timeout */ + rtd->pmdown_time = pmdown_time; + + /* do machine specific initialization */ + if (dai_link->init) { + ret = dai_link->init(rtd); + if (ret < 0) { + dev_err(card->dev, "ASoC: failed to init %s: %d\n", + dai_link->name, ret); + return ret; + } + } + + if (dai_link->dai_fmt) { + ret = snd_soc_runtime_set_dai_fmt(rtd, dai_link->dai_fmt); + if (ret) + return ret; + } + + /* add DPCM sysfs entries */ + soc_dpcm_debugfs_add(rtd); + + num = rtd->num; + + /* + * most drivers will register their PCMs using DAI link ordering but + * topology based drivers can use the DAI link id field to set PCM + * device number and then use rtd + a base offset of the BEs. + */ + for_each_rtd_components(rtd, rtdcom, component) { + if (!component->driver->use_dai_pcm_id) + continue; + + if (rtd->dai_link->no_pcm) + num += component->driver->be_pcm_base; + else + num = rtd->dai_link->id; + } + + /* create compress_device if possible */ + ret = snd_soc_dai_compress_new(cpu_dai, rtd, num); + if (ret != -ENOTSUPP) { + if (ret < 0) + dev_err(card->dev, "ASoC: can't create compress %s\n", + dai_link->stream_name); + return ret; + } + + /* create the pcm */ + ret = soc_new_pcm(rtd, num); + if (ret < 0) { + dev_err(card->dev, "ASoC: can't create pcm %s :%d\n", + dai_link->stream_name, ret); + return ret; + } + ret = soc_dai_pcm_new(&cpu_dai, 1, rtd); + if (ret < 0) + return ret; + ret = soc_dai_pcm_new(rtd->codec_dais, + rtd->num_codecs, rtd); + return ret; +} + static void soc_set_of_name_prefix(struct snd_soc_component *component) { struct device_node *of_node = soc_component_to_node(component); @@ -1400,78 +1472,6 @@ static int soc_probe_link_components(struct snd_soc_card *card) return 0; }
-static int soc_link_init(struct snd_soc_card *card, - struct snd_soc_pcm_runtime *rtd) -{ - struct snd_soc_dai_link *dai_link = rtd->dai_link; - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; - struct snd_soc_rtdcom_list *rtdcom; - struct snd_soc_component *component; - int ret, num; - - /* set default power off timeout */ - rtd->pmdown_time = pmdown_time; - - /* do machine specific initialization */ - if (dai_link->init) { - ret = dai_link->init(rtd); - if (ret < 0) { - dev_err(card->dev, "ASoC: failed to init %s: %d\n", - dai_link->name, ret); - return ret; - } - } - - if (dai_link->dai_fmt) { - ret = snd_soc_runtime_set_dai_fmt(rtd, dai_link->dai_fmt); - if (ret) - return ret; - } - - /* add DPCM sysfs entries */ - soc_dpcm_debugfs_add(rtd); - - num = rtd->num; - - /* - * most drivers will register their PCMs using DAI link ordering but - * topology based drivers can use the DAI link id field to set PCM - * device number and then use rtd + a base offset of the BEs. - */ - for_each_rtd_components(rtd, rtdcom, component) { - if (!component->driver->use_dai_pcm_id) - continue; - - if (rtd->dai_link->no_pcm) - num += component->driver->be_pcm_base; - else - num = rtd->dai_link->id; - } - - /* create compress_device if possible */ - ret = snd_soc_dai_compress_new(cpu_dai, rtd, num); - if (ret != -ENOTSUPP) { - if (ret < 0) - dev_err(card->dev, "ASoC: can't create compress %s\n", - dai_link->stream_name); - return ret; - } - - /* create the pcm */ - ret = soc_new_pcm(rtd, num); - if (ret < 0) { - dev_err(card->dev, "ASoC: can't create pcm %s :%d\n", - dai_link->stream_name, ret); - return ret; - } - ret = soc_dai_pcm_new(&cpu_dai, 1, rtd); - if (ret < 0) - return ret; - ret = soc_dai_pcm_new(rtd->codec_dais, - rtd->num_codecs, rtd); - return ret; -} - static void soc_unbind_aux_dev(struct snd_soc_card *card) { struct snd_soc_component *component, *_component;
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
soc_link_init() returns error code, but snd_soc_bind_card() is not cheking it. This patch adds missing return value check for it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/soc-core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 79a4753..bdae48e 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1983,8 +1983,11 @@ static int snd_soc_bind_card(struct snd_soc_card *card) goto probe_end; }
- for_each_card_rtds(card, rtd) - soc_link_init(card, rtd); + for_each_card_rtds(card, rtd) { + ret = soc_link_init(card, rtd); + if (ret < 0) + goto probe_end; + }
snd_soc_dapm_link_dai_widgets(card); snd_soc_dapm_connect_dai_link_widgets(card);
The patch
ASoC: soc-core: add missing return value check for soc_link_init()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
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
From 626c2e57a33a7565af03b2eb95989c43be651a03 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 10 Dec 2019 09:34:40 +0900 Subject: [PATCH] ASoC: soc-core: add missing return value check for soc_link_init()
soc_link_init() returns error code, but snd_soc_bind_card() is not cheking it. This patch adds missing return value check for it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/87zhg1xbkv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/soc-core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 04cb69072f80..2af3df5d0d72 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1983,8 +1983,11 @@ static int snd_soc_bind_card(struct snd_soc_card *card) goto probe_end; }
- for_each_card_rtds(card, rtd) - soc_link_init(card, rtd); + for_each_card_rtds(card, rtd) { + ret = soc_link_init(card, rtd); + if (ret < 0) + goto probe_end; + }
snd_soc_dapm_link_dai_widgets(card); snd_soc_dapm_connect_dai_link_widgets(card);
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
soc-core is using soc_link_init(). It sounds like dai_link function, but it is for pcm_runtime. This patch renames soc_link_init() to soc_init_pcm_runtime().
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/soc-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index bdae48e..6396556 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1123,8 +1123,8 @@ static int soc_dai_pcm_new(struct snd_soc_dai **dais, int num_dais, return 0; }
-static int soc_link_init(struct snd_soc_card *card, - struct snd_soc_pcm_runtime *rtd) +static int soc_init_pcm_runtime(struct snd_soc_card *card, + struct snd_soc_pcm_runtime *rtd) { struct snd_soc_dai_link *dai_link = rtd->dai_link; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; @@ -1984,7 +1984,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card) }
for_each_card_rtds(card, rtd) { - ret = soc_link_init(card, rtd); + ret = soc_init_pcm_runtime(card, rtd); if (ret < 0) goto probe_end; }
The patch
ASoC: soc-core: rename soc_link_init() to soc_init_pcm_runtime()
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
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
From eaffeefbd042a44ca31f60f299a27d899aa4ec26 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 10 Dec 2019 09:34:44 +0900 Subject: [PATCH] ASoC: soc-core: rename soc_link_init() to soc_init_pcm_runtime()
soc-core is using soc_link_init(). It sounds like dai_link function, but it is for pcm_runtime. This patch renames soc_link_init() to soc_init_pcm_runtime().
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/87y2vlxbkr.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/soc-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 2af3df5d0d72..d18e30ec5a12 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1123,8 +1123,8 @@ static int soc_dai_pcm_new(struct snd_soc_dai **dais, int num_dais, return 0; }
-static int soc_link_init(struct snd_soc_card *card, - struct snd_soc_pcm_runtime *rtd) +static int soc_init_pcm_runtime(struct snd_soc_card *card, + struct snd_soc_pcm_runtime *rtd) { struct snd_soc_dai_link *dai_link = rtd->dai_link; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; @@ -1984,7 +1984,7 @@ static int snd_soc_bind_card(struct snd_soc_card *card) }
for_each_card_rtds(card, rtd) { - ret = soc_link_init(card, rtd); + ret = soc_init_pcm_runtime(card, rtd); if (ret < 0) goto probe_end; }
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Current soc_set_name_prefix() for loop is checking both codec_conf pointer and its number
for (...; i < card->num_configs && card->codec_conf; ...)
But, if card->num_configs exists but card->codec_conf was NULL, it is just bug. This patch cleanups for loop condition.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/soc-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 6396556..057c97c 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1211,7 +1211,7 @@ static void soc_set_name_prefix(struct snd_soc_card *card, { int i;
- for (i = 0; i < card->num_configs && card->codec_conf; i++) { + for (i = 0; i < card->num_configs; i++) { struct snd_soc_codec_conf *map = &card->codec_conf[i]; struct device_node *of_node = soc_component_to_node(component);
The patch
ASoC: soc-core: soc_set_name_prefix(): tidyup loop condition
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
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
From 4702f99148dae94b00bcb7bbba6cd9ca01651e69 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 10 Dec 2019 09:34:48 +0900 Subject: [PATCH] ASoC: soc-core: soc_set_name_prefix(): tidyup loop condition
Current soc_set_name_prefix() for loop is checking both codec_conf pointer and its number
for (...; i < card->num_configs && card->codec_conf; ...)
But, if card->num_configs exists but card->codec_conf was NULL, it is just bug. This patch cleanups for loop condition.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/87wob5xbkn.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/soc-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d18e30ec5a12..a483f6fc50a0 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1211,7 +1211,7 @@ static void soc_set_name_prefix(struct snd_soc_card *card, { int i;
- for (i = 0; i < card->num_configs && card->codec_conf; i++) { + for (i = 0; i < card->num_configs; i++) { struct snd_soc_codec_conf *map = &card->codec_conf[i]; struct device_node *of_node = soc_component_to_node(component);
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Component device_node is not related to codec_conf loop at soc_set_name_prefix(). This patch moves it to out of loop.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/soc/soc-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 057c97c..0180d3a 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1209,11 +1209,11 @@ static void soc_set_of_name_prefix(struct snd_soc_component *component) static void soc_set_name_prefix(struct snd_soc_card *card, struct snd_soc_component *component) { + struct device_node *of_node = soc_component_to_node(component); int i;
for (i = 0; i < card->num_configs; i++) { struct snd_soc_codec_conf *map = &card->codec_conf[i]; - struct device_node *of_node = soc_component_to_node(component);
if (map->of_node && of_node != map->of_node) continue;
The patch
ASoC: soc-core: soc_set_name_prefix(): get component device_node at out of loop
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
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
From aec3ff99ce4a02d9bbe8b7311136edc69bdb739d Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 10 Dec 2019 09:34:52 +0900 Subject: [PATCH] ASoC: soc-core: soc_set_name_prefix(): get component device_node at out of loop
Component device_node is not related to codec_conf loop at soc_set_name_prefix(). This patch moves it to out of loop.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Reviewed-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Link: https://lore.kernel.org/r/87v9qpxbkj.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/soc-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index a483f6fc50a0..f662d677229b 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1209,11 +1209,11 @@ static void soc_set_of_name_prefix(struct snd_soc_component *component) static void soc_set_name_prefix(struct snd_soc_card *card, struct snd_soc_component *component) { + struct device_node *of_node = soc_component_to_node(component); int i;
for (i = 0; i < card->num_configs; i++) { struct snd_soc_codec_conf *map = &card->codec_conf[i]; - struct device_node *of_node = soc_component_to_node(component);
if (map->of_node && of_node != map->of_node) continue;
participants (2)
-
Kuninori Morimoto
-
Mark Brown