public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] universal_c210: check the NULL pointer when get the PMIC
@ 2012-12-10 13:50 Minkyu Kang
  2012-12-11  3:58 ` [U-Boot] [PATCH v2] " Minkyu Kang
  0 siblings, 1 reply; 4+ messages in thread
From: Minkyu Kang @ 2012-12-10 13:50 UTC (permalink / raw)
  To: u-boot

PMIC 2.0 require to test return pointer from pmic_get()

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Wolfgang Denk <wd@denx.de>
---
 board/samsung/universal_c210/universal.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/board/samsung/universal_c210/universal.c b/board/samsung/universal_c210/universal.c
index 4869798..ae24469 100644
--- a/board/samsung/universal_c210/universal.c
+++ b/board/samsung/universal_c210/universal.c
@@ -343,6 +343,9 @@ static void init_pmic_lcd(void)
 
 	struct pmic *p = pmic_get("MAX8998_PMIC");
 
+	if (!p)
+		return -ENODEV;
+
 	if (pmic_probe(p))
 		return;
 
@@ -434,6 +437,9 @@ static void lcd_power_on(void)
 {
 	struct pmic *p = pmic_get("MAX8998_PMIC");
 
+	if (!p)
+		return -ENODEV;
+
 	if (pmic_probe(p))
 		return;
 
-- 
1.7.9.5

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

end of thread, other threads:[~2012-12-11 10:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-10 13:50 [U-Boot] [PATCH] universal_c210: check the NULL pointer when get the PMIC Minkyu Kang
2012-12-11  3:58 ` [U-Boot] [PATCH v2] " Minkyu Kang
2012-12-11  7:57   ` Lukasz Majewski
2012-12-11 10:49     ` Minkyu Kang

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