11 May
2020
11 May
'20
3:41 a.m.
Hi Ranjani
When registering a component, make sure that the driver names are unique. This will ensure that the snd_soc_rtdcom_lookup() function returns the right component based on the name.
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com
(snip)
+static bool +snd_soc_component_driver_name_is_unique(const struct snd_soc_component_driver *component_driver) +{
- struct snd_soc_component *component;
- mutex_lock(&client_mutex);
- for_each_component(component)
if (!strcmp(component->driver->name, component_driver->name)) {
mutex_unlock(&client_mutex);
return false;
}
- mutex_unlock(&client_mutex);
- return true;
+}
I think it will be more readable if it doesn't have multiple mutex_unlock().
{ int ret = true;
mutex_lock(); for_each_component() if (...) { ... ret = false; } mutex_unlock(); return ret; }
Thank you for your help !!
Best regards --- Kuninori Morimoto