mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
ANDROID: ASoC: core: add locked version of soc_find_component
Add a locked version of the API to use from clients to ensure accessing component list safely. Change-Id: I73c7f2ed03b7e76f6816b62ba0974bc05bdbb4b4 Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org> (cherry picked from commit 99b4176aaa40d18f46ae637a41578842e6c85abe) Signed-off-by: Will McVicker <willmcvicker@google.com>
This commit is contained in:
committed by
Alistair Delva
parent
9bd91249d2
commit
75fe91933b
@@ -748,6 +748,28 @@ struct snd_soc_component *soc_find_component(
|
||||
}
|
||||
EXPORT_SYMBOL(soc_find_component);
|
||||
|
||||
/**
|
||||
* soc_find_component_locked: soc_find_component with client lock acquired
|
||||
*
|
||||
* @of_node: of_node of the component to query.
|
||||
* @name: name of the component to query.
|
||||
*
|
||||
* function to find out if a component is already registered with ASoC core.
|
||||
*
|
||||
* Returns component handle for success, else NULL error.
|
||||
*/
|
||||
struct snd_soc_component *soc_find_component_locked(
|
||||
const struct device_node *of_node, const char *name)
|
||||
{
|
||||
struct snd_soc_component *component = NULL;
|
||||
|
||||
mutex_lock(&client_mutex);
|
||||
component = soc_find_component(of_node, name);
|
||||
mutex_unlock(&client_mutex);
|
||||
return component;
|
||||
}
|
||||
EXPORT_SYMBOL(soc_find_component_locked);
|
||||
|
||||
/**
|
||||
* snd_soc_find_dai - Find a registered DAI
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user