i2c: Fix i2c speed command
PATCH 1/1 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 Darwin Rambo <[email protected]>
Reviewed-by Tim Kryger <[email protected]>
Reviewed-by Steve Rae <[email protected]>
--- drivers/i2c/i2c_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/i2c_core.c +1 -1
@@ -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; }
Signature · 1 line
1.7.9.5
PATCH 1/1 i2c: Fix i2c speed command
Quoted 18 lines · Darwin Rambo
This corrects i2c core to interpret the value returned by
i2c_set_bus_speedas a success indicator rather than the actual speed that was set. Wheni2c_set_bus_speedreturns a failure code, the speed is unknown so the adapter speed is set to zero.Signed-off-by Darwin Rambo <[email protected]>Reviewed-by Tim Kryger <[email protected]>Reviewed-by Steve Rae <[email protected]>--- drivers/i2c/i2c_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/i2c_core.c +0
-0
drivers/i2c/i2c_core.c unsigned int i2c_set_bus_speed(unsigned int speed) · line 355
Quoted 8 lines
drivers/i2c/i2c_core.c +1
-1@@ -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; }
Signature · 8 lines
Thanks, Jagan. -------- Jagannadha Sutradharudu Teki, E: jagannadh.teki at gmail.com, P: +91-9676773388 Engineer - System Software Hacker U-boot - SPI Custodian and Zynq APSOC Ln: http://www.linkedin.com/in/jaganteki