[U-Boot] [PATCH] pmic: tps65090: correct checking i2c bus

The function tps65090_init checks the i2c bus of p->bus. However the pointer p is not intialiased at this point. Check the local variable bus instead.
cc: Tom Wai-Hong Tam waihong@chromium.org cc: Simon Glass sjg@chromium.org Signed-off-by: Jeroen Hofstee jeroen@myspectrum.nl --- drivers/power/pmic/pmic_tps65090.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/pmic/pmic_tps65090.c b/drivers/power/pmic/pmic_tps65090.c index c5b3966..337903a 100644 --- a/drivers/power/pmic/pmic_tps65090.c +++ b/drivers/power/pmic/pmic_tps65090.c @@ -285,7 +285,7 @@ int tps65090_init(void) }
bus = i2c_get_bus_num_fdt(parent); - if (p->bus < 0) { + if (bus < 0) { debug("%s: Cannot find I2C bus\n", __func__); return -ENOENT; }

On 15 June 2014 08:17, Jeroen Hofstee jeroen@myspectrum.nl wrote:
The function tps65090_init checks the i2c bus of p->bus. However the pointer p is not intialiased at this point. Check the local variable bus instead.
cc: Tom Wai-Hong Tam waihong@chromium.org cc: Simon Glass sjg@chromium.org Signed-off-by: Jeroen Hofstee jeroen@myspectrum.nl
Acked-by: Simon Glass sjg@chromium.org

On Sun, Jun 15, 2014 at 05:17:04PM +0200, Jeroen Hofstee wrote:
The function tps65090_init checks the i2c bus of p->bus. However the pointer p is not intialiased at this point. Check the local variable bus instead.
cc: Tom Wai-Hong Tam waihong@chromium.org cc: Simon Glass sjg@chromium.org Signed-off-by: Jeroen Hofstee jeroen@myspectrum.nl Acked-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!
participants (3)
-
Jeroen Hofstee
-
Simon Glass
-
Tom Rini