]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
sound: maxim_codec: Fix coding mistake
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 12 Aug 2025 10:26:06 +0000 (11:26 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 21 Aug 2025 16:02:40 +0000 (10:02 -0600)
In maxim_i2c_read the code mistakenly just returned the return value
from dm_i2c_read leaving the following code unreachable. Instead assign
ret to be the return value from dm_i2c_read so that the following code
can operate as expected.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/sound/maxim_codec.c

index 98f094c0e9adf96f02e365ad298ee75758567068..505a739ad7d3d8c8f3279457069c2f7e84c313b4 100644 (file)
@@ -45,7 +45,7 @@ unsigned int maxim_i2c_read(struct maxim_priv *priv, unsigned int reg,
 {
        int ret;
 
-       return dm_i2c_read(priv->dev, reg, data, 1);
+       ret = dm_i2c_read(priv->dev, reg, data, 1);
        if (ret != 0) {
                debug("%s: Error while reading register %#04x\n",
                      __func__, reg);