aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/pxafb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/pxafb.c')
-rw-r--r--drivers/video/pxafb.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index 7dcda187d9ba..736ee1d3206d 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -1778,11 +1778,49 @@ failed:
1778 return ret; 1778 return ret;
1779} 1779}
1780 1780
1781static int __devexit pxafb_remove(struct platform_device *dev)
1782{
1783 struct pxafb_info *fbi = platform_get_drvdata(dev);
1784 struct resource *r;
1785 int irq;
1786 struct fb_info *info;
1787
1788 if (!fbi)
1789 return 0;
1790
1791 info = &fbi->fb;
1792
1793 unregister_framebuffer(info);
1794
1795 pxafb_disable_controller(fbi);
1796
1797 if (fbi->fb.cmap.len)
1798 fb_dealloc_cmap(&fbi->fb.cmap);
1799
1800 irq = platform_get_irq(dev, 0);
1801 free_irq(irq, fbi);
1802
1803 dma_free_writecombine(&dev->dev, fbi->map_size,
1804 fbi->map_cpu, fbi->map_dma);
1805
1806 iounmap(fbi->mmio_base);
1807
1808 r = platform_get_resource(dev, IORESOURCE_MEM, 0);
1809 release_mem_region(r->start, r->end - r->start + 1);
1810
1811 clk_put(fbi->clk);
1812 kfree(fbi);
1813
1814 return 0;
1815}
1816
1781static struct platform_driver pxafb_driver = { 1817static struct platform_driver pxafb_driver = {
1782 .probe = pxafb_probe, 1818 .probe = pxafb_probe,
1819 .remove = pxafb_remove,
1783 .suspend = pxafb_suspend, 1820 .suspend = pxafb_suspend,
1784 .resume = pxafb_resume, 1821 .resume = pxafb_resume,
1785 .driver = { 1822 .driver = {
1823 .owner = THIS_MODULE,
1786 .name = "pxa2xx-fb", 1824 .name = "pxa2xx-fb",
1787 }, 1825 },
1788}; 1826};
@@ -1795,7 +1833,13 @@ static int __devinit pxafb_init(void)
1795 return platform_driver_register(&pxafb_driver); 1833 return platform_driver_register(&pxafb_driver);
1796} 1834}
1797 1835
1836static void __exit pxafb_exit(void)
1837{
1838 platform_driver_unregister(&pxafb_driver);
1839}
1840
1798module_init(pxafb_init); 1841module_init(pxafb_init);
1842module_exit(pxafb_exit);
1799 1843
1800MODULE_DESCRIPTION("loadable framebuffer driver for PXA"); 1844MODULE_DESCRIPTION("loadable framebuffer driver for PXA");
1801MODULE_LICENSE("GPL"); 1845MODULE_LICENSE("GPL");