lkml.org 
[lkml]   [2023]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] ASoC: codecs: Modify the wrong judgment of re value
Date
From: Weidong Wang <wangweidong.a@awinic.com>

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>
---
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 47fe38d0def5..936d7d3767f3 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
\
 
 \ /
  Last update: 2023-11-01 08:05    [W:0.030 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site