All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][RFC] ASoC: soc-pcm: fixup module_put() calling timing
@ 2019-05-17  8:16 Kuninori Morimoto
  2019-05-18 17:53 ` Ranjani Sridharan
  0 siblings, 1 reply; 2+ messages in thread
From: Kuninori Morimoto @ 2019-05-17  8:16 UTC (permalink / raw)
  To: Mark Brown, Pierre-Louis Bossart, Liam Girdwood, Jaroslav Kysela,
	Vinod Koul
  Cc: Linux-ALSA


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

soc_pcm_components_close() try to call module_put()
based on component->driver->module_get_upon_open.
But, it should be called even though it doesn't have .close callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
Mark, Pierre-Louis, Vinod, Liam

I think this patch is correct, but I'm not sure.
I'm happy if someone can confirm it.

 sound/soc/soc-pcm.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 7b4cda6..e24eab3 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -477,11 +477,9 @@ static int soc_pcm_components_close(struct snd_pcm_substream *substream,
 		if (component == last)
 			break;
 
-		if (!component->driver->ops ||
-		    !component->driver->ops->close)
-			continue;
-
-		component->driver->ops->close(substream);
+		if (component->driver->ops &&
+		    component->driver->ops->close)
+			component->driver->ops->close(substream);
 
 		if (component->driver->module_get_upon_open)
 			module_put(component->dev->driver->owner);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][RFC] ASoC: soc-pcm: fixup module_put() calling timing
  2019-05-17  8:16 [PATCH][RFC] ASoC: soc-pcm: fixup module_put() calling timing Kuninori Morimoto
@ 2019-05-18 17:53 ` Ranjani Sridharan
  0 siblings, 0 replies; 2+ messages in thread
From: Ranjani Sridharan @ 2019-05-18 17:53 UTC (permalink / raw)
  To: Kuninori Morimoto, Mark Brown, Pierre-Louis Bossart,
	Liam Girdwood, Jaroslav Kysela, Vinod Koul
  Cc: Linux-ALSA

On Fri, 2019-05-17 at 17:16 +0900, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> soc_pcm_components_close() try to call module_put()
> based on component->driver->module_get_upon_open.
> But, it should be called even though it doesn't have .close callback.
I think this makes sense. Thanks!

Ranjani
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> Mark, Pierre-Louis, Vinod, Liam
> 
> I think this patch is correct, but I'm not sure.
> I'm happy if someone can confirm it.
> 
>  sound/soc/soc-pcm.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
> index 7b4cda6..e24eab3 100644
> --- a/sound/soc/soc-pcm.c
> +++ b/sound/soc/soc-pcm.c
> @@ -477,11 +477,9 @@ static int soc_pcm_components_close(struct
> snd_pcm_substream *substream,
>  		if (component == last)
>  			break;
>  
> -		if (!component->driver->ops ||
> -		    !component->driver->ops->close)
> -			continue;
> -
> -		component->driver->ops->close(substream);
> +		if (component->driver->ops &&
> +		    component->driver->ops->close)
> +			component->driver->ops->close(substream);
>  
>  		if (component->driver->module_get_upon_open)
>  			module_put(component->dev->driver->owner);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-18 17:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-17  8:16 [PATCH][RFC] ASoC: soc-pcm: fixup module_put() calling timing Kuninori Morimoto
2019-05-18 17:53 ` Ranjani Sridharan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.