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 <andrew.goodbody@linaro.org>
This commit is contained in:
Andrew Goodbody 2025-08-12 11:26:06 +01:00 committed by Tom Rini
parent b436af0641
commit 2b751d42c3

View 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);