msm_fb: check null pointer before reading backlight on status

Since msm_fb_blank_sub() can be called from hdmi which has no
backlight, we should check the null pointer before to run the
get_backlight_on_status().

Change-Id: I9a91dc337b56e20fbfd82347cf429350f1a72b37
This commit is contained in:
choongryeol.lee 2012-07-30 11:37:25 -07:00 committed by Iliyan Malchev
parent fba6280818
commit a87d0e534a

View file

@ -905,13 +905,16 @@ static int msm_fb_blank_sub(int blank_mode, struct fb_info *info,
mfd->op_enable = FALSE;
curr_pwr_state = mfd->panel_power_on;
while (pdata->get_backlight_on_status() && time_out) {
if (pdata->get_backlight_on_status) {
while (pdata->get_backlight_on_status()
&& time_out) {
msleep(1);
time_out --;
}
if (time_out == 0)
pr_err("%s : timeout for waiting backlight turn on\n", __func__);
pr_err("%s : timeout for waiting backlight turn on\n",
__func__);
}
/* clean fb to prevent displaying old fb */
memset((void *)info->screen_base, 0,
info->fix.smem_len);