ASoC: codecs: Modify the wrong judgment of re value

An error code should be return when the re is greater
than the maximum value or less than the minimum value

Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Link: https://lore.kernel.org/r/20231101090211.177125-3-wangweidong.a@awinic.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Weidong Wang 2023-11-01 17:02:09 +08:00 committed by Mark Brown
parent c9e920ffa7
commit baf46c3c76
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -486,8 +486,8 @@ static int aw_dev_update_cali_re(struct aw_cali_desc *cali_desc)
u32 cali_re;
int ret;
if ((aw_dev->cali_desc.cali_re <= AW88399_CALI_RE_MAX) ||
(aw_dev->cali_desc.cali_re >= AW88399_CALI_RE_MIN))
if ((aw_dev->cali_desc.cali_re >= AW88399_CALI_RE_MAX) ||
(aw_dev->cali_desc.cali_re <= AW88399_CALI_RE_MIN))
return -EINVAL;
cali_re = AW88399_SHOW_RE_TO_DSP_RE((aw_dev->cali_desc.cali_re +