Re: [PATCH v3 6/8] ASoC: soc-pcm: call snd_soc_component_open/close() once

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

 



Hi Morimoto-san,

  #define for_each_component_dais(component, dai)\
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
index 14e175c..ee00c09 100644
--- a/sound/soc/soc-component.c
+++ b/sound/soc/soc-component.c
@@ -297,34 +297,55 @@ EXPORT_SYMBOL_GPL(snd_soc_component_set_jack);
  int snd_soc_component_module_get(struct snd_soc_component *component,
  				 int upon_open)
  {
+	if (component->module)
+		return 0;
+
  	if (component->driver->module_get_upon_open == !!upon_open &&
  	    !try_module_get(component->dev->driver->owner))
  		return -ENODEV;
+ component->module = 1;
+

Maybe a red-herring but is there a potential for race conditions here if that function is called twice from different places? Don't we need some sort of lock for all the new flags introduced here?

Thanks
-Pierre
_______________________________________________
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