]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00171987 ipuv3 fb: add error handler for mxcfb_blank
authorJason Chen <b02280@freescale.com>
Fri, 13 Jan 2012 09:04:36 +0000 (17:04 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:33:53 +0000 (08:33 +0200)
add error handler for mxcfb_blank.

Signed-off-by: Jason Chen <b02280@freescale.com>
(cherry picked from commit 1999793303187b4aa9ccbdfc53f9a4c6ab59e749)

drivers/video/mxc/mxc_ipuv3_fb.c

index 23202cea02b732f5ef6c57657c9bd81904318178..ba43b512e33a251e0aba815857d6e1c93ec14d71 100644 (file)
@@ -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;
 }
 
 /*