mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-12-20 08:52:12 +01:00
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:
parent
b436af0641
commit
2b751d42c3
@ -45,7 +45,7 @@ unsigned int maxim_i2c_read(struct maxim_priv *priv, unsigned int reg,
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
return dm_i2c_read(priv->dev, reg, data, 1);
|
ret = dm_i2c_read(priv->dev, reg, data, 1);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
debug("%s: Error while reading register %#04x\n",
|
debug("%s: Error while reading register %#04x\n",
|
||||||
__func__, reg);
|
__func__, reg);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user