mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-29 16:10:24 +09:00
tqma6: add warning on failed setup_i2c
setup_i2c has a return value. Use it to give feedback on error. Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
This commit is contained in:
parent
8cc65d383e
commit
fd53ec5baf
@ -181,8 +181,14 @@ static struct i2c_pads_info tqma6_i2c3_pads = {
|
|||||||
|
|
||||||
static void tqma6_setup_i2c(void)
|
static void tqma6_setup_i2c(void)
|
||||||
{
|
{
|
||||||
/* use logical index for bus, e.g. I2C1 -> 0 */
|
int ret;
|
||||||
setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &tqma6_i2c3_pads);
|
/*
|
||||||
|
* use logical index for bus, e.g. I2C1 -> 0
|
||||||
|
* warn on error
|
||||||
|
*/
|
||||||
|
ret = setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &tqma6_i2c3_pads);
|
||||||
|
if (ret)
|
||||||
|
printf("setup I2C3 failed: %d\n", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
int board_early_init_f(void)
|
int board_early_init_f(void)
|
||||||
|
@ -224,8 +224,14 @@ static struct i2c_pads_info mba6_i2c1_pads = {
|
|||||||
|
|
||||||
static void mba6_setup_i2c(void)
|
static void mba6_setup_i2c(void)
|
||||||
{
|
{
|
||||||
/* use logical index for bus, e.g. I2C1 -> 0 */
|
int ret;
|
||||||
setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &mba6_i2c1_pads);
|
/*
|
||||||
|
* use logical index for bus, e.g. I2C1 -> 0
|
||||||
|
* warn on error
|
||||||
|
*/
|
||||||
|
ret = setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &mba6_i2c1_pads);
|
||||||
|
if (ret)
|
||||||
|
printf("setup I2C1 failed: %d\n", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user