public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] board/BuR/kwb: fix usage of 'i2c_set_bus_speed'
@ 2014-03-07 17:56 Hannes Petermaier
  2014-03-08 17:38 ` Gerhard Sittig
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Hannes Petermaier @ 2014-03-07 17:56 UTC (permalink / raw)
  To: u-boot

- fix: return-value of 'i2c_set_bus_speed' was interpreted wrong

Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
---
 board/BuR/kwb/board.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/BuR/kwb/board.c b/board/BuR/kwb/board.c
index 8aa16bc..8fb5e68 100644
--- a/board/BuR/kwb/board.c
+++ b/board/BuR/kwb/board.c
@@ -120,7 +120,7 @@ void am33xx_spl_board_init(void)
 
 	/* power-ON  3V3 via Resetcontroller */
 	oldspeed = i2c_get_bus_speed();
-	if (0 != i2c_set_bus_speed(CONFIG_SYS_OMAP24_I2C_SPEED_PSOC)) {
+	if (0 <= i2c_set_bus_speed(CONFIG_SYS_OMAP24_I2C_SPEED_PSOC)) {
 		buf = RSTCTRL_FORCE_PWR_NEN;
 		i2c_write(RSTCTRL_ADDR, RSTCTRL_CTRLREG, 1,
 			  (uint8_t *)&buf, sizeof(buf));
@@ -221,7 +221,7 @@ int board_late_init(void)
 			   TPS65217_WLEDCTRL1, 0x09, 0xFF);
 	/* write bootinfo into scratchregister of resetcontroller */
 	oldspeed = i2c_get_bus_speed();
-	if (0 != i2c_set_bus_speed(CONFIG_SYS_OMAP24_I2C_SPEED_PSOC)) {
+	if (0 <= i2c_set_bus_speed(CONFIG_SYS_OMAP24_I2C_SPEED_PSOC)) {
 		i2c_write(RSTCTRL_ADDR, RSTCTRL_SCRATCHREG, 1,
 			  (uint8_t *)&buf, sizeof(buf));
 		i2c_set_bus_speed(oldspeed);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-03-12 20:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-07 17:56 [U-Boot] [PATCH] board/BuR/kwb: fix usage of 'i2c_set_bus_speed' Hannes Petermaier
2014-03-08 17:38 ` Gerhard Sittig
2014-03-08 18:14   ` Hannes Petermaier
2014-03-08 19:45     ` Gerhard Sittig
2014-03-08 18:09 ` [U-Boot] [PATCH v2] " Hannes Petermaier
2014-03-12 20:23   ` [U-Boot] [U-Boot, " Tom Rini
2014-03-12 20:04 ` [U-Boot] " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox