aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/imxfb.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-01-15 09:37:22 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2009-03-13 05:34:07 -0400
commitc0b90a31efe30987ab4bb21298b410913779e62f (patch)
treee7af49770ed004899663582ad931aae2d076102f /drivers/video/imxfb.c
parent879fea1b486d2b6fa399c40b8aed172b0dfdedb9 (diff)
imxfb: add platform specific init/exit functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/video/imxfb.c')
-rw-r--r--drivers/video/imxfb.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index d58c68cd456e..629d66f32300 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -650,6 +650,12 @@ static int __init imxfb_probe(struct platform_device *pdev)
650 info->fix.smem_start = fbi->screen_dma; 650 info->fix.smem_start = fbi->screen_dma;
651 } 651 }
652 652
653 if (pdata->init) {
654 ret = pdata->init(fbi->pdev);
655 if (ret)
656 goto failed_platform_init;
657 }
658
653 /* 659 /*
654 * This makes sure that our colour bitfield 660 * This makes sure that our colour bitfield
655 * descriptors are correctly initialised. 661 * descriptors are correctly initialised.
@@ -674,6 +680,9 @@ static int __init imxfb_probe(struct platform_device *pdev)
674failed_register: 680failed_register:
675 fb_dealloc_cmap(&info->cmap); 681 fb_dealloc_cmap(&info->cmap);
676failed_cmap: 682failed_cmap:
683 if (pdata->exit)
684 pdata->exit(fbi->pdev);
685failed_platform_init:
677 if (!pdata->fixed_screen_cpu) 686 if (!pdata->fixed_screen_cpu)
678 dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu, 687 dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu,
679 fbi->map_dma); 688 fbi->map_dma);
@@ -691,6 +700,7 @@ failed_init:
691 700
692static int __devexit imxfb_remove(struct platform_device *pdev) 701static int __devexit imxfb_remove(struct platform_device *pdev)
693{ 702{
703 struct imx_fb_platform_data *pdata;
694 struct fb_info *info = platform_get_drvdata(pdev); 704 struct fb_info *info = platform_get_drvdata(pdev);
695 struct imxfb_info *fbi = info->par; 705 struct imxfb_info *fbi = info->par;
696 struct resource *res; 706 struct resource *res;
@@ -701,6 +711,10 @@ static int __devexit imxfb_remove(struct platform_device *pdev)
701 711
702 unregister_framebuffer(info); 712 unregister_framebuffer(info);
703 713
714 pdata = pdev->dev.platform_data;
715 if (pdata->exit)
716 pdata->exit(fbi->pdev);
717
704 fb_dealloc_cmap(&info->cmap); 718 fb_dealloc_cmap(&info->cmap);
705 kfree(info->pseudo_palette); 719 kfree(info->pseudo_palette);
706 framebuffer_release(info); 720 framebuffer_release(info);