[U-Boot] universal_c210: fix compiler error and compiler warning

Wolfgang Denk
2012-12-10T09:06:42Z

Dear Minkyu Kang,

In message <50C58623.3090308@samsung.com> you wrote:
...
> @@ -337,7 +341,7 @@ static void init_pmic_lcd(void)
> unsigned char val;
> int ret = 0;
>
> - struct pmic *p = get_pmic();
> + struct pmic *p = pmic_get("MAX8998_PMIC");
>
> if (pmic_probe(p))
> return;
> @@ -428,7 +432,7 @@ static void reset_lcd(void)
>
> static void lcd_power_on(void)
> {
> - struct pmic *p = get_pmic();
> + struct pmic *p = pmic_get("MAX8998_PMIC");
>
> if (pmic_probe(p))
> return;

This is unrelated to your patch - but what if pmic_get() returns NULL?

pmic_probe() will crashif you pass it a NULL pointer...

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Digital computers are themselves more complex than most things people
build: They have very large numbers of states. This makes conceiving,
describing, and testing them hard. Software systems have orders-of-
magnitude more states than computers do. - Fred Brooks, Jr.