From: Andrew Goodbody Date: Tue, 12 Aug 2025 10:26:06 +0000 (+0100) Subject: sound: maxim_codec: Fix coding mistake X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b751d42c35c36f7e3739d7bc7064f014e1263c7;p=thirdparty%2Fu-boot.git sound: maxim_codec: Fix coding mistake 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 --- diff --git a/drivers/sound/maxim_codec.c b/drivers/sound/maxim_codec.c index 98f094c0e9a..505a739ad7d 100644 --- a/drivers/sound/maxim_codec.c +++ b/drivers/sound/maxim_codec.c @@ -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);