]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
universal_c210: check the NULL pointer when get the PMIC
authorMinkyu Kang <mk7.kang@samsung.com>
Mon, 10 Dec 2012 13:43:57 +0000 (22:43 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Tue, 11 Dec 2012 08:37:28 +0000 (17:37 +0900)
PMIC 2.0 require to test return pointer from pmic_get()

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
board/samsung/universal_c210/universal.c

index 48697982839b896408f41e2db4e30c550d326f37..e742707f79659dca95b19fb4b6b91f27f093e0e8 100644 (file)
@@ -343,6 +343,9 @@ static void init_pmic_lcd(void)
 
        struct pmic *p = pmic_get("MAX8998_PMIC");
 
+       if (!p)
+               return;
+
        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;
+
        if (pmic_probe(p))
                return;