Re: [PATCH 15/15] ASoC: soc-core: add soc_unbind_aux_dev()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sridharan

Thank you for your feedback

>     From: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
>    
>     It is easy to read code if it is cleanly using paired function/naming,
>     like start <-> stop, register <-> unregister, etc, etc.
>     But, current ALSA SoC code is very random, unbalance, not paired, etc.
>     It is easy to create bug at the such code, and it will be difficult to
>     debug.
>    
>     soc-core.c has soc_bind_aux_dev(), but, there is no its paired
>     soc_unbind_aux_dev(). This patch adds it.
> 
> Morimoto-san,
> I'm not sure it quite improves readability to just have list_del in unbind_aux_dev(). bin_aux_dev() does more than just
> adding to the card_aux_list(). So in fact, I think  this change makes it look unbalanced.

Hmm...
But, bind_aux_dev() is doing

	1) find target component
	2) setup component->init
	3) add card_aux_list

We can ignore 1) for unbind.
This patch is for 3).
I guess we can ignore 2), but can handle it.
How about this ?

	static void soc_unbind_aux_dev(struct snd_soc_component *component)
	{
=>		component->init = NULL;
		list_del(&component->card_aux_list);
	}

> The existing code for aux_dev looks quite similar to what bind_dai_link() and remove_dai_link() do and they are quite
> intuitive.

I guess "add"_dai_link instead of "bind"_dai_link ?

Thank you for your help !!
Best regards
---
Kuninori Morimoto
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux