]> git.sur5r.net Git - u-boot/commitdiff
tqma6: add warning on failed setup_i2c
authorMarkus Niebel <Markus.Niebel@tq-group.com>
Tue, 18 Nov 2014 12:22:56 +0000 (13:22 +0100)
committerStefano Babic <sbabic@denx.de>
Thu, 20 Nov 2014 09:30:21 +0000 (10:30 +0100)
setup_i2c has a return value. Use it to give feedback
on error.

Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
board/tqc/tqma6/tqma6.c
board/tqc/tqma6/tqma6_mba6.c

index 5e913d7cf7cc9d8b33d7da08eba100f2601d0baa..b7f4eb76331643023be1610d474070f023c0b54e 100644 (file)
@@ -181,8 +181,14 @@ static struct i2c_pads_info tqma6_i2c3_pads = {
 
 static void tqma6_setup_i2c(void)
 {
-       /* use logical index for bus, e.g. I2C1 -> 0 */
-       setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &tqma6_i2c3_pads);
+       int ret;
+       /*
+        * 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)
index fd592875d8cc51b4f380612e8290392661a23ee7..6f4cffd95ecd3b3dbf1df181f9998f7936a5f570 100644 (file)
@@ -224,8 +224,14 @@ static struct i2c_pads_info mba6_i2c1_pads = {
 
 static void mba6_setup_i2c(void)
 {
-       /* use logical index for bus, e.g. I2C1 -> 0 */
-       setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &mba6_i2c1_pads);
+       int ret;
+       /*
+        * 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);
 }