mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 23:51:33 +00:00
i2c: mvtwsi.c: Avoid NULL dereference
For '#ifndef CONFIG_DM_I2C' twsi_i2c_init() passes NULL as 4th parameter to __twsi_i2c_init(). Identified with cppcheck. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
9cef983d1c
commit
8bcf12ccce
1 changed files with 2 additions and 1 deletions
|
@ -490,6 +490,7 @@ static void __twsi_i2c_init(struct mvtwsi_registers *twsi, int speed,
|
|||
/* Reset controller */
|
||||
twsi_reset(twsi);
|
||||
/* Set speed */
|
||||
if (actual_speed)
|
||||
*actual_speed = __twsi_i2c_set_bus_speed(twsi, speed);
|
||||
/* Set slave address; even though we don't use it */
|
||||
writel(slaveadd, &twsi->slave_address);
|
||||
|
|
Loading…
Reference in a new issue