提交 ba1aa324 编写于 作者: H Haojian Zhuang 提交者: Eric Miao

ARM: pxa168fb: add .remove function

The pxa168fb driver is missing .remove function so the framebuffer isn't
correctly shut down when the module is removed.
Signed-off-by: NMarek Vasut <marek.vasut@gmail.com>
Signed-off-by: NHaojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: NEric Miao <eric.y.miao@gmail.com>
上级 6aafc5f3
...@@ -784,12 +784,53 @@ static int __devinit pxa168fb_probe(struct platform_device *pdev) ...@@ -784,12 +784,53 @@ static int __devinit pxa168fb_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int __devexit pxa168fb_remove(struct platform_device *pdev)
{
struct pxa168fb_info *fbi = platform_get_drvdata(pdev);
struct fb_info *info;
int irq;
unsigned int data;
if (!fbi)
return 0;
/* disable DMA transfer */
data = readl(fbi->reg_base + LCD_SPU_DMA_CTRL0);
data &= ~CFG_GRA_ENA_MASK;
writel(data, fbi->reg_base + LCD_SPU_DMA_CTRL0);
info = fbi->info;
unregister_framebuffer(info);
writel(GRA_FRAME_IRQ0_ENA(0x0), fbi->reg_base + SPU_IRQ_ENA);
if (info->cmap.len)
fb_dealloc_cmap(&info->cmap);
irq = platform_get_irq(pdev, 0);
free_irq(irq, fbi);
dma_free_writecombine(fbi->dev, PAGE_ALIGN(info->fix.smem_len),
info->screen_base, info->fix.smem_start);
iounmap(fbi->reg_base);
clk_disable(fbi->clk);
clk_put(fbi->clk);
framebuffer_release(info);
return 0;
}
static struct platform_driver pxa168fb_driver = { static struct platform_driver pxa168fb_driver = {
.driver = { .driver = {
.name = "pxa168-fb", .name = "pxa168-fb",
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, },
.probe = pxa168fb_probe, .probe = pxa168fb_probe,
.remove = __devexit_p(pxa168fb_remove),
}; };
static int __init pxa168fb_init(void) static int __init pxa168fb_init(void)
...@@ -798,6 +839,12 @@ static int __init pxa168fb_init(void) ...@@ -798,6 +839,12 @@ static int __init pxa168fb_init(void)
} }
module_init(pxa168fb_init); module_init(pxa168fb_init);
static void __exit pxa168fb_exit(void)
{
platform_driver_unregister(&pxa168fb_driver);
}
module_exit(pxa168fb_exit);
MODULE_AUTHOR("Lennert Buytenhek <buytenh@marvell.com> " MODULE_AUTHOR("Lennert Buytenhek <buytenh@marvell.com> "
"Green Wan <gwan@marvell.com>"); "Green Wan <gwan@marvell.com>");
MODULE_DESCRIPTION("Framebuffer driver for PXA168/910"); MODULE_DESCRIPTION("Framebuffer driver for PXA168/910");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册