]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ASoC: codecs: Fix error handling in aw_dev_get_dsp_status function
authorZhu Jun <zhujun2@cmss.chinamobile.com>
Wed, 9 Oct 2024 07:39:38 +0000 (00:39 -0700)
committerMark Brown <broonie@kernel.org>
Thu, 10 Oct 2024 11:15:01 +0000 (12:15 +0100)
Added proper error handling for register value check that
return -EPERM when register value does not meet expected condition

Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
Link: https://patch.msgid.link/20241009073938.7472-1-zhujun2@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/aw88399.c

index 8dc2b8aa6832d5f8a75e31f335bcba0b61b72ab5..bba59885242d0c01751b99d8652d4238b23b991f 100644 (file)
@@ -656,7 +656,7 @@ static int aw_dev_get_dsp_status(struct aw_device *aw_dev)
        if (ret)
                return ret;
        if (!(reg_val & (~AW88399_WDT_CNT_MASK)))
-               ret = -EPERM;
+               return -EPERM;
 
        return 0;
 }