ASoC: wsa881x: use pm_runtime_resume_and_get()

simplify the flow. No functionality change, except that on -EACCESS
the reference count will be decreased.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220616220427.136036-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Pierre-Louis Bossart 2022-06-16 17:04:21 -05:00 committed by Mark Brown
parent ddea4bbf28
commit 9a1a28610a
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -749,11 +749,9 @@ static int wsa881x_put_pa_gain(struct snd_kcontrol *kc,
unsigned int mask = (1 << fls(max)) - 1;
int val, ret, min_gain, max_gain;
ret = pm_runtime_get_sync(comp->dev);
if (ret < 0 && ret != -EACCES) {
pm_runtime_put_noidle(comp->dev);
ret = pm_runtime_resume_and_get(comp->dev);
if (ret < 0 && ret != -EACCES)
return ret;
}
max_gain = (max - ucontrol->value.integer.value[0]) & mask;
/*