[v2,resend,01/18] ASoC: soc-core: remove unneeded snd_soc_tplg_component_remove()
diff mbox series

Message ID 8736fbdnwt.wl-kuninori.morimoto.gx@renesas.com
State New
Headers show
Series
  • ASoC: soc-core cleanup - step 4
Related show

Commit Message

Kuninori Morimoto Oct. 30, 2019, 1:26 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

snd_soc_tplg_component_remove() is pair of snd_soc_tplg_component_load(),
and it is topology related cleanup function.

The driver which called _load() needs to call _remove() by its responsibility.
Today, skl-pcm and topology are the user, and these are calling both
_load() and _remove().

soc-core doesn't need to call it.
This patch remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/soc-core.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Sridharan, Ranjani Nov. 5, 2019, 2:55 a.m. UTC | #1
On Tue, Oct 29, 2019 at 6:28 PM Kuninori Morimoto <
kuninori.morimoto.gx@renesas.com> wrote:

> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> snd_soc_tplg_component_remove() is pair of snd_soc_tplg_component_load(),
> and it is topology related cleanup function.
>
> The driver which called _load() needs to call _remove() by its
> responsibility.
> Today, skl-pcm and topology are the user, and these are calling both
> _load() and _remove().
>
> soc-core doesn't need to call it.
> This patch remove it.
>
Morimoto-san,

When I submitted changes for fixing module load/unload errors with SOF, I
had a patch that added this change. At that time, Mark commented that this
can be left as is to make the unregister_component() robust.

Mark, do you still think it should be left as is or are you OK to remove
this?

Thanks,
Ranjani

>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  sound/soc/soc-core.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index f1b41b0..b07ecfa 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -2890,8 +2890,6 @@ static int __snd_soc_unregister_component(struct
> device *dev)
>                 if (dev != component->dev)
>                         continue;
>
> -               snd_soc_tplg_component_remove(component,
> -                                             SND_SOC_TPLG_INDEX_ALL);
>                 snd_soc_component_del_unlocked(component);
>                 found = 1;
>                 break;
> --
> 2.7.4
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
Kuninori Morimoto Nov. 5, 2019, 4:02 a.m. UTC | #2
Hi Sridharan

Thank you for your feedback

>     From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>    
>     snd_soc_tplg_component_remove() is pair of snd_soc_tplg_component_load(),
>     and it is topology related cleanup function.
>    
>     The driver which called _load() needs to call _remove() by its responsibility.
>     Today, skl-pcm and topology are the user, and these are calling both
>     _load() and _remove().
>    
>     soc-core doesn't need to call it.
>     This patch remove it.
(snip)
> When I submitted changes for fixing module load/unload errors with SOF, I had a patch that added this change. At that time,
> Mark commented that this can be left as is to make the unregister_component() robust.
> 
> Mark, do you still think it should be left as is or are you OK to remove this?

This is already accepted by

	e9904ed5e73af4fd00cf4fcf705420a385af45da
	("ASoC: soc-core: remove unneeded snd_soc_tplg_component_remove()")

But, I'm OK to keep/reborn it as "robust".
Then, I want to have comment, like below.
Otherwise, it is confusable for non-topology user.

	/* For framework level robustness */
	snd_soc_tplg_component_remove(...)


Thank you for your help !!
Best regards
---
Kuninori Morimoto

Patch
diff mbox series

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index f1b41b0..b07ecfa 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2890,8 +2890,6 @@  static int __snd_soc_unregister_component(struct device *dev)
 		if (dev != component->dev)
 			continue;
 
-		snd_soc_tplg_component_remove(component,
-					      SND_SOC_TPLG_INDEX_ALL);
 		snd_soc_component_del_unlocked(component);
 		found = 1;
 		break;