Skip to content
Snippets Groups Projects
Commit 7cc1b02f authored by Darwin Rambo's avatar Darwin Rambo Committed by Heiko Schocher
Browse files

i2c: Fix i2c speed command


This corrects i2c core to interpret the value returned by
i2c_set_bus_speed as a success indicator rather than the
actual speed that was set. When i2c_set_bus_speed returns
a failure code, the speed is unknown so the adapter speed
is set to zero.

Signed-off-by: default avatarDarwin Rambo <drambo@broadcom.com>
Reviewed-by: default avatarTim Kryger <tim.kryger@linaro.org>
Reviewed-by: default avatarSteve Rae <srae@broadcom.com>
Acked-by: default avatarJagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
parent 6d001e7d
No related branches found
No related tags found
No related merge requests found
......@@ -349,7 +349,7 @@ unsigned int i2c_set_bus_speed(unsigned int speed)
return 0;
ret = I2C_ADAP->set_bus_speed(I2C_ADAP, speed);
if (gd->flags & GD_FLG_RELOC)
I2C_ADAP->speed = ret;
I2C_ADAP->speed = (ret == 0) ? speed : 0;
return ret;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment