]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00211133 IPUv3 fb:Check boot opt to decide if disp fb'll be present
authorLiu Ying <Ying.Liu@freescale.com>
Fri, 25 May 2012 09:50:19 +0000 (17:50 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:44 +0000 (08:34 +0200)
This patch checks video boot option to decide whether we'll register
certain display framebuffer devices. The user may add video=mxcfbx:off
to kernel bootup command line to disable a display framebuffer
register. The 'x' means that the display number presented in kernel.
Defaultly, all display framebuffers will be registered if the user
doesn't specify related 'off' option in kernel bootup command line.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
drivers/video/mxc/mxc_ipuv3_fb.c

index 2d0ec842e7df27e96bf47d944e0026104b2d3883..4b2a19df0abb0d2c42d591b3126f7ed25addeb31 100644 (file)
@@ -1771,7 +1771,10 @@ static int mxcfb_option_setup(struct platform_device *pdev)
        char name[] = "mxcfb0";
 
        name[5] += pdev->id;
-       fb_get_options(name, &options);
+       if (fb_get_options(name, &options)) {
+               dev_err(&pdev->dev, "Can't get fb option for %s!\n", name);
+               return -ENODEV;
+       }
 
        if (!options || !*options)
                return 0;
@@ -2046,17 +2049,17 @@ static int mxcfb_probe(struct platform_device *pdev)
        struct resource *res;
        int ret = 0;
 
-       /*
-        * Initialize FB structures
-        */
+       ret = mxcfb_option_setup(pdev);
+       if (ret)
+               goto get_fb_option_failed;
+
+       /* Initialize FB structures */
        fbi = mxcfb_init_fbinfo(&pdev->dev, &mxcfb_ops);
        if (!fbi) {
                ret = -ENOMEM;
                goto init_fbinfo_failed;
        }
 
-       mxcfb_option_setup(pdev);
-
        mxcfbi = (struct mxcfb_info *)fbi->par;
        mxcfbi->ipu_int_clk = plat_data->int_clk;
        ret = mxcfb_dispdrv_init(pdev, fbi);
@@ -2166,6 +2169,7 @@ init_dispdrv_failed:
        fb_dealloc_cmap(&fbi->cmap);
        framebuffer_release(fbi);
 init_fbinfo_failed:
+get_fb_option_failed:
        return ret;
 }