Skip to content
Unverified Commit 635071f5 authored by Robert Hancock's avatar Robert Hancock Committed by Mark Brown
Browse files

ASoC: simple-card-utils: fix PCM constraint error check

The code in asoc_simple_startup was treating any non-zero return from
snd_pcm_hw_constraint_minmax as an error, when this can return 1 in some
normal cases and only negative values indicate an error.

When this happened, it caused asoc_simple_startup to disable the clocks
it just enabled and return 1, which was not treated as an error by the
calling code which only checks for negative return values. Then when the
PCM is eventually shut down, it causes the clock framework to complain
about disabling clocks that were not enabled.

Fix the check for snd_pcm_hw_constraint_minmax return value to only
treat negative values as an error.

Fixes: 5ca2ab45

 ("ASoC: simple-card-utils: Add new system-clock-fixed flag")
Signed-off-by: default avatarRobert Hancock <robert.hancock@calian.com>
Link: https://lore.kernel.org/r/20230602011936.231931-1-robert.hancock@calian.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ce789307
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment