Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] ASoC: pcm: perform power-down delay checks a bit faster
@ 2024-04-09 17:56 Dragan Simic
  2024-04-09 20:43 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Dragan Simic @ 2024-04-09 17:56 UTC (permalink / raw)
  To: linux-sound; +Cc: lgirdwood, broonie, perex, tiwai, linux-kernel

When checking whether the power-down delay should be ignored for a specific
PCM runtime, there's no need to keep going through all DAI link components
after any of them is found to be configured to use the power-down delay.

While there, fix a small typo in one of the comment blocks.

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
---
 sound/soc/soc-pcm.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 77ee103b7cd1..b0e1bd7f588b 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -315,23 +315,24 @@ EXPORT_SYMBOL_GPL(snd_soc_runtime_action);
  * @rtd: The ASoC PCM runtime that should be checked.
  *
  * This function checks whether the power down delay should be ignored for a
- * specific PCM runtime. Returns true if the delay is 0, if it the DAI link has
+ * specific PCM runtime. Returns true if the delay is 0, if the DAI link has
  * been configured to ignore the delay, or if none of the components benefits
  * from having the delay.
  */
 bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd)
 {
 	struct snd_soc_component *component;
-	bool ignore = true;
 	int i;
 
 	if (!rtd->pmdown_time || rtd->dai_link->ignore_pmdown_time)
 		return true;
 
 	for_each_rtd_components(rtd, i, component)
-		ignore &= !component->driver->use_pmdown_time;
+		if (component->driver->use_pmdown_time)
+			/* No need to go through all components */
+			return false;
 
-	return ignore;
+	return true;
 }
 
 /**

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

end of thread, other threads:[~2024-04-09 20:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-09 17:56 [PATCH] ASoC: pcm: perform power-down delay checks a bit faster Dragan Simic
2024-04-09 20:43 ` Mark Brown
2024-04-09 20:51   ` Dragan Simic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox