diff mbox series

ASoC: pcm: perform power-down delay checks a bit faster

Message ID 90ae761a5b99640ece48363a7099ac2cf402bd37.1712684592.git.dsimic@manjaro.org (mailing list archive)
State Accepted
Commit f78bf2c933c9cb3b61215378664f83c5abd25374
Headers show
Series ASoC: pcm: perform power-down delay checks a bit faster | expand

Commit Message

Dragan Simic April 9, 2024, 5:56 p.m. UTC
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(-)

Comments

Mark Brown April 9, 2024, 8:43 p.m. UTC | #1
On Tue, 09 Apr 2024 19:56:36 +0200, Dragan Simic wrote:
> 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.
> 
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: pcm: perform power-down delay checks a bit faster
      commit: f78bf2c933c9cb3b61215378664f83c5abd25374

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Dragan Simic April 9, 2024, 8:51 p.m. UTC | #2
On 2024-04-09 22:43, Mark Brown wrote:
> On Tue, 09 Apr 2024 19:56:36 +0200, Dragan Simic wrote:
>> 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.
>> 
>> 
>> [...]
> 
> Applied to
> 
>    https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 
> for-next
> 
> Thanks!
> 
> [1/1] ASoC: pcm: perform power-down delay checks a bit faster
>       commit: f78bf2c933c9cb3b61215378664f83c5abd25374

Great, thanks!

> All being well this means that it will be integrated into the 
> linux-next
> tree (usually sometime in the next 24 hours) and sent to Linus during
> the next merge window (or sooner if it is a bug fix), however if
> problems are discovered then the patch may be dropped or reverted.
> 
> You may get further e-mails resulting from automated or manual testing
> and review of the tree, please engage with people reporting problems 
> and
> send followup patches addressing any issues that are reported if 
> needed.
> 
> If any updates are required or you are submitting further changes they
> should be sent as incremental updates against current git, existing
> patches will not be replaced.
> 
> Please add any relevant lists and maintainers to the CCs when replying
> to this mail.
> 
> Thanks,
> Mark
diff mbox series

Patch

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;
 }
 
 /**