diff options
author | Pramod Gurav <pramod.gurav@smartplayin.com> | 2014-08-26 14:10:37 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-08-26 14:53:33 +0200 |
commit | 0c46575f7c7dea4068924f2c0d938232f68a5cda (patch) | |
tree | 1398e9bbbdec492fc0a3d4b3014760c915f3af09 /drivers/video | |
parent | video: mx3fb: Update comment for dmaengine_prep_slave_sg() API (diff) | |
download | linux-0c46575f7c7dea4068924f2c0d938232f68a5cda.tar.xz linux-0c46575f7c7dea4068924f2c0d938232f68a5cda.zip |
msm: msm_fb: Add remove function for platform driver for clean unloading
This adds a remove function to platform driver structure so that
resources are released when driver is unloaded.
Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
CC: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
CC: Tomi Valkeinen <tomi.valkeinen@ti.com>
CC: Stephen Boyd <sboyd@codeaurora.org>
CC: Jingoo Han <jg1.han@samsung.com>
CC: Rob Clark <robdclark@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fbdev/msm/msm_fb.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/video/fbdev/msm/msm_fb.c b/drivers/video/fbdev/msm/msm_fb.c index 1374803fbcd9..4640188ffd6e 100644 --- a/drivers/video/fbdev/msm/msm_fb.c +++ b/drivers/video/fbdev/msm/msm_fb.c @@ -589,6 +589,8 @@ static int msmfb_probe(struct platform_device *pdev) msmfb->sleeping = WAKING; + platform_set_drvdata(pdev, msmfb); + return 0; error_register_framebuffer: @@ -598,9 +600,23 @@ error_setup_fbmem: return ret; } +static int msmfb_remove(struct platform_device *pdev) +{ + struct msmfb_info *msmfb; + + msmfb = platform_get_drvdata(pdev); + + unregister_framebuffer(msmfb->fb); + iounmap(msmfb->fb->screen_base); + framebuffer_release(msmfb->fb); + + return 0; +} + static struct platform_driver msm_panel_driver = { /* need to write remove */ .probe = msmfb_probe, + .remove = msmfb_remove, .driver = {.name = "msm_panel"}, }; |