[PATCH V2 2/3] ASoC: codecs: Modify the wrong judgment of re value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



From: Weidong Wang <wangweidong.a@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 sound/soc/codecs/aw88399.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/aw88399.c b/sound/soc/codecs/aw88399.c
index 1d6228cb1cc2..54f8457e8497 100644
--- a/sound/soc/codecs/aw88399.c
+++ b/sound/soc/codecs/aw88399.c
@@ -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 +
-- 
2.41.0




[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux