diff options
author | Mark Brown <broonie@kernel.org> | 2019-04-26 11:02:03 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-04-26 11:02:03 +0100 |
commit | 93f38ef6a4b62fd57076d36d1345d69f8a328ad9 (patch) | |
tree | bc7f20d968c8d1f7374927bd187d3f26f786459d /sound/soc/soc-pcm.c | |
parent | 552f2d7edd38e29073f8036191320f09b534c480 (diff) | |
parent | 780f202f2bf48aaa09282efc4dd6c39a146cc1f3 (diff) | |
download | linux-93f38ef6a4b62fd57076d36d1345d69f8a328ad9.tar.gz |
Merge branch 'asoc-5.1' into asoc-5.2
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r-- | sound/soc/soc-pcm.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 035dedee78f1..74695355c1f8 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -15,6 +15,7 @@ #include <linux/delay.h> #include <linux/pinctrl/consumer.h> #include <linux/pm_runtime.h> +#include <linux/module.h> #include <linux/slab.h> #include <linux/workqueue.h> #include <linux/export.h> @@ -463,6 +464,9 @@ static int soc_pcm_components_close(struct snd_pcm_substream *substream, continue; component->driver->ops->close(substream); + + if (component->driver->module_get_upon_open) + module_put(component->dev->driver->owner); } return 0; @@ -513,6 +517,10 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) !component->driver->ops->open) continue; + if (component->driver->module_get_upon_open && + !try_module_get(component->dev->driver->owner)) + return -ENODEV; + ret = component->driver->ops->open(substream); if (ret < 0) { dev_err(component->dev, |