瀏覽代碼

ASoC: Cleanup DAI module reference counting

Currently when a DAI has no CODEC associated to it the reference on the module
containing the DAI driver is increased when the DAI is probed and decrease when
the DAI is removed. For DAIs with CODECs the module reference count was already
incremented when the CODEC is probed. Now that all components have their module
reference count incremented when they are probed and all DAIs do have a
component it is possible to remove the module reference counting on DAI probe
and removal.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Lars-Peter Clausen 11 年之前
父節點
當前提交
ffbd7dd72b
共有 1 個文件被更改,包括 0 次插入8 次删除
  1. 0 8
      sound/soc/soc-core.c

+ 0 - 8
sound/soc/soc-core.c

@@ -1067,8 +1067,6 @@ static void soc_remove_link_dais(struct snd_soc_card *card, int num, int order)
 					cpu_dai->name, err);
 					cpu_dai->name, err);
 		}
 		}
 		cpu_dai->probed = 0;
 		cpu_dai->probed = 0;
-		if (!cpu_dai->codec)
-			module_put(cpu_dai->dev->driver->owner);
 	}
 	}
 }
 }
 
 
@@ -1422,18 +1420,12 @@ static int soc_probe_link_dais(struct snd_soc_card *card, int num, int order)
 	/* probe the cpu_dai */
 	/* probe the cpu_dai */
 	if (!cpu_dai->probed &&
 	if (!cpu_dai->probed &&
 			cpu_dai->driver->probe_order == order) {
 			cpu_dai->driver->probe_order == order) {
-		if (!cpu_dai->codec) {
-			if (!try_module_get(cpu_dai->dev->driver->owner))
-				return -ENODEV;
-		}
-
 		if (cpu_dai->driver->probe) {
 		if (cpu_dai->driver->probe) {
 			ret = cpu_dai->driver->probe(cpu_dai);
 			ret = cpu_dai->driver->probe(cpu_dai);
 			if (ret < 0) {
 			if (ret < 0) {
 				dev_err(cpu_dai->dev,
 				dev_err(cpu_dai->dev,
 					"ASoC: failed to probe CPU DAI %s: %d\n",
 					"ASoC: failed to probe CPU DAI %s: %d\n",
 					cpu_dai->name, ret);
 					cpu_dai->name, ret);
-				module_put(cpu_dai->dev->driver->owner);
 				return ret;
 				return ret;
 			}
 			}
 		}
 		}