* [PATCH] ASoC: soc-pcm: tidyup function name to snd_soc_dpcm_be_can_xxx()
@ 2025-03-06 1:59 Kuninori Morimoto
2025-03-06 10:50 ` Amadeusz Sławiński
0 siblings, 1 reply; 3+ messages in thread
From: Kuninori Morimoto @ 2025-03-06 1:59 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-sound
We have similar but different function names
snd_soc_dpcm_fe_can_xxx()
snd_soc_dpcm_be_can_xxx()
snd_soc_dpcm_can_be_xxx()
~~~~~~
Let's unified these to can_xx
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
sound/soc/soc-pcm.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 8d88971bdea3..73b05b8f5a07 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -36,7 +36,7 @@ static inline int _soc_pcm_ret(struct snd_soc_pcm_runtime *rtd,
/* is the current PCM operation for this FE ? */
#if 0
-static int snd_soc_dpcm_fe_can_update(struct snd_soc_pcm_runtime *fe, int stream)
+static int snd_soc_dpcm_can_fe_update(struct snd_soc_pcm_runtime *fe, int stream)
{
if (fe->dpcm[stream].runtime_update == SND_SOC_DPCM_UPDATE_FE)
return 1;
@@ -1632,7 +1632,7 @@ void dpcm_be_dai_stop(struct snd_soc_pcm_runtime *fe, int stream,
return;
/* is this op for this BE ? */
- if (!snd_soc_dpcm_be_can_update(fe, be, stream))
+ if (!snd_soc_dpcm_can_be_update(fe, be, stream))
continue;
if (be->dpcm[stream].users == 0) {
@@ -1682,7 +1682,7 @@ int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream)
}
/* is this op for this BE ? */
- if (!snd_soc_dpcm_be_can_update(fe, be, stream))
+ if (!snd_soc_dpcm_can_be_update(fe, be, stream))
continue;
/* first time the dpcm is open ? */
@@ -2007,7 +2007,7 @@ void dpcm_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream)
snd_soc_dpcm_get_substream(be, stream);
/* is this op for this BE ? */
- if (!snd_soc_dpcm_be_can_update(fe, be, stream))
+ if (!snd_soc_dpcm_can_be_update(fe, be, stream))
continue;
/* only free hw when no longer used - check all FEs */
@@ -2073,7 +2073,7 @@ int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream)
be_substream = snd_soc_dpcm_get_substream(be, stream);
/* is this op for this BE ? */
- if (!snd_soc_dpcm_be_can_update(fe, be, stream))
+ if (!snd_soc_dpcm_can_be_update(fe, be, stream))
continue;
/* copy params for each dpcm */
@@ -2118,7 +2118,7 @@ int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream)
be = dpcm->be;
be_substream = snd_soc_dpcm_get_substream(be, stream);
- if (!snd_soc_dpcm_be_can_update(fe, be, stream))
+ if (!snd_soc_dpcm_can_be_update(fe, be, stream))
continue;
/* only allow hw_free() if no connected FEs are running */
@@ -2188,7 +2188,7 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,
snd_pcm_stream_lock_irqsave_nested(be_substream, flags);
/* is this op for this BE ? */
- if (!snd_soc_dpcm_be_can_update(fe, be, stream))
+ if (!snd_soc_dpcm_can_be_update(fe, be, stream))
goto next;
dev_dbg(be->dev, "ASoC: trigger BE %s cmd %d\n",
@@ -2465,7 +2465,7 @@ int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream)
snd_soc_dpcm_get_substream(be, stream);
/* is this op for this BE ? */
- if (!snd_soc_dpcm_be_can_update(fe, be, stream))
+ if (!snd_soc_dpcm_can_be_update(fe, be, stream))
continue;
if (!snd_soc_dpcm_can_be_prepared(fe, be, stream))
@@ -2623,7 +2623,7 @@ static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream)
struct snd_soc_pcm_runtime *be = dpcm->be;
/* is this op for this BE ? */
- if (!snd_soc_dpcm_be_can_update(fe, be, stream))
+ if (!snd_soc_dpcm_can_be_update(fe, be, stream))
continue;
if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_CLOSE ||
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] ASoC: soc-pcm: tidyup function name to snd_soc_dpcm_be_can_xxx()
2025-03-06 1:59 [PATCH] ASoC: soc-pcm: tidyup function name to snd_soc_dpcm_be_can_xxx() Kuninori Morimoto
@ 2025-03-06 10:50 ` Amadeusz Sławiński
2025-03-10 1:53 ` Kuninori Morimoto
0 siblings, 1 reply; 3+ messages in thread
From: Amadeusz Sławiński @ 2025-03-06 10:50 UTC (permalink / raw)
To: Kuninori Morimoto, Mark Brown; +Cc: linux-sound
On 3/6/2025 2:59 AM, Kuninori Morimoto wrote:
> We have similar but different function names
>
> snd_soc_dpcm_fe_can_xxx()
> snd_soc_dpcm_be_can_xxx()
> snd_soc_dpcm_can_be_xxx()
> ~~~~~~
> Let's unified these to can_xx
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> sound/soc/soc-pcm.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
> index 8d88971bdea3..73b05b8f5a07 100644
> --- a/sound/soc/soc-pcm.c
> +++ b/sound/soc/soc-pcm.c
> @@ -36,7 +36,7 @@ static inline int _soc_pcm_ret(struct snd_soc_pcm_runtime *rtd,
>
> /* is the current PCM operation for this FE ? */
> #if 0
> -static int snd_soc_dpcm_fe_can_update(struct snd_soc_pcm_runtime *fe, int stream)
> +static int snd_soc_dpcm_can_fe_update(struct snd_soc_pcm_runtime *fe, int stream)
> {
> if (fe->dpcm[stream].runtime_update == SND_SOC_DPCM_UPDATE_FE)
> return 1;
> @@ -1632,7 +1632,7 @@ void dpcm_be_dai_stop(struct snd_soc_pcm_runtime *fe, int stream,
> return;
>
> /* is this op for this BE ? */
> - if (!snd_soc_dpcm_be_can_update(fe, be, stream))
> + if (!snd_soc_dpcm_can_be_update(fe, be, stream))
Not sure if some part of patch is missing, but shouldn't definition of
snd_soc_dpcm_be_can_update() be converted somewhere? I see only calls
and _fe variant.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] ASoC: soc-pcm: tidyup function name to snd_soc_dpcm_be_can_xxx()
2025-03-06 10:50 ` Amadeusz Sławiński
@ 2025-03-10 1:53 ` Kuninori Morimoto
0 siblings, 0 replies; 3+ messages in thread
From: Kuninori Morimoto @ 2025-03-10 1:53 UTC (permalink / raw)
To: Amadeusz Sławiński; +Cc: Mark Brown, linux-sound
Hi Amadeusz
Thank you for your reply
> > /* is this op for this BE ? */
> > - if (!snd_soc_dpcm_be_can_update(fe, be, stream))
> > + if (!snd_soc_dpcm_can_be_update(fe, be, stream))
>
> Not sure if some part of patch is missing, but shouldn't definition of
> snd_soc_dpcm_be_can_update() be converted somewhere? I see only calls
> and _fe variant.
I have updated the patch just before posting, but there was a mistake then.
Thank you for pointing it. Will post v2
Best regards
---
Kuninori Morimoto
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-10 1:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-06 1:59 [PATCH] ASoC: soc-pcm: tidyup function name to snd_soc_dpcm_be_can_xxx() Kuninori Morimoto
2025-03-06 10:50 ` Amadeusz Sławiński
2025-03-10 1:53 ` Kuninori Morimoto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox