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