On Tue, Jul 25, 2017 at 04:00:48AM +0000, Kuninori Morimoto wrote:
ALSA SoC platform/codec will be replaced to component soon. This means 1 device might have multiple components. But current unregister component function only checks "dev" to find it. This means, unexpected component might be unregistered by current function. But, it is no problem if driver registered only 1 component.
Isn't this just a convenience for drivers though? It means they can just clean things up with one call and I'm having a hard time thinking of any use cases for only unregistering some components.
To avoid this issue, this patch adds new component unregister_exp/lookup/remove functions. "lookup" function finds component by "dev" and "driver name", and "remove" function removes it. "unregister_exp" will use these functions.
The exp name here seems a bit confusing... perhaps just _internal() or something?
+#define snd_soc_unregister_component(dev) snd_soc_unregister_component_exp(dev, NULL)
A static inline is better, it's got better type safety.