[alsa-devel] [PATCH 1/3] ASoC: soc-core: add component remove/unregister_exp/lookup functions

Mark Brown broonie at kernel.org
Wed Aug 2 13:05:49 CEST 2017


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20170802/fe9505da/attachment.sig>


More information about the Alsa-devel mailing list