From: Jason Chen Date: Fri, 13 Jan 2012 09:04:36 +0000 (+0800) Subject: ENGR00171987 ipuv3 fb: add error handler for mxcfb_blank X-Git-Tag: v3.0.35-fsl~1570 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bafcdabd725100b61c5ba808acf1f958167b5d69;p=karo-tx-linux.git ENGR00171987 ipuv3 fb: add error handler for mxcfb_blank add error handler for mxcfb_blank. Signed-off-by: Jason Chen (cherry picked from commit 1999793303187b4aa9ccbdfc53f9a4c6ab59e749) --- diff --git a/drivers/video/mxc/mxc_ipuv3_fb.c b/drivers/video/mxc/mxc_ipuv3_fb.c index 23202cea02b7..ba43b512e33a 100644 --- a/drivers/video/mxc/mxc_ipuv3_fb.c +++ b/drivers/video/mxc/mxc_ipuv3_fb.c @@ -1,5 +1,5 @@ /* - * Copyright 2004-2011 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2004-2012 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -265,6 +265,7 @@ static int _setup_disp_channel2(struct fb_info *fbi) if (retval) { dev_err(fbi->device, "ipu_init_channel_buffer error %d\n", retval); + return retval; } /* update u/v offset */ @@ -442,8 +443,10 @@ static int mxcfb_set_par(struct fb_info *fbi) } retval = _setup_disp_channel2(fbi); - if (retval) + if (retval) { + ipu_uninit_channel(mxc_fbi->ipu, mxc_fbi->ipu_ch); return retval; + } ipu_enable_channel(mxc_fbi->ipu, mxc_fbi->ipu_ch); @@ -1174,6 +1177,7 @@ static int mxcfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) static int mxcfb_blank(int blank, struct fb_info *info) { struct mxcfb_info *mxc_fbi = (struct mxcfb_info *)info->par; + int ret = 0; dev_dbg(info->device, "blank = %d\n", blank); @@ -1195,11 +1199,12 @@ static int mxcfb_blank(int blank, struct fb_info *info) ipu_uninit_channel(mxc_fbi->ipu, mxc_fbi->ipu_ch); break; case FB_BLANK_UNBLANK: - mxcfb_set_par(info); + ret = mxcfb_set_par(info); break; } - mxc_fbi->cur_blank = blank; - return 0; + if (!ret) + mxc_fbi->cur_blank = blank; + return ret; } /*