diff options
| author | Andrew Goodbody <[email protected]> | 2025-08-12 11:26:06 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-08-21 10:02:40 -0600 |
| commit | 2b751d42c35c36f7e3739d7bc7064f014e1263c7 (patch) | |
| tree | 4548cddbc629b1aaa7dbe36431f850f2b6c1af25 | |
| parent | b436af06419adee8e63f4ee4482fba561831d25d (diff) | |
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 <[email protected]>
| -rw-r--r-- | drivers/sound/maxim_codec.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |
