diff options
author | Jaya Kumar <jayakumar.arm@gmail.com> | 2008-06-21 23:27:28 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-07-07 08:23:38 -0400 |
commit | 9f17f2874834f4cdbe48cc05676d8f7558793204 (patch) | |
tree | ac8658a13290f166afaf88484ecece193014f87e /drivers/video/pxafb.c | |
parent | 5a2cc50f166babc26103279c4fbc9f2bf73b79de (diff) |
[ARM] 5118/1: pxafb: add exit and remove handlers
This patch adds exit and remove handlers to pxafb so that it can be loaded
and unloaded as a module.
Signed-off-by: Jaya Kumar <jayakumar.lkml@gmail.com>
Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Acked-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/video/pxafb.c')
-rw-r--r-- | drivers/video/pxafb.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 3ee314beacc1..3682bbd7e50e 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -1777,11 +1777,49 @@ failed: | |||
1777 | return ret; | 1777 | return ret; |
1778 | } | 1778 | } |
1779 | 1779 | ||
1780 | static int __devexit pxafb_remove(struct platform_device *dev) | ||
1781 | { | ||
1782 | struct pxafb_info *fbi = platform_get_drvdata(dev); | ||
1783 | struct resource *r; | ||
1784 | int irq; | ||
1785 | struct fb_info *info; | ||
1786 | |||
1787 | if (!fbi) | ||
1788 | return 0; | ||
1789 | |||
1790 | info = &fbi->fb; | ||
1791 | |||
1792 | unregister_framebuffer(info); | ||
1793 | |||
1794 | pxafb_disable_controller(fbi); | ||
1795 | |||
1796 | if (fbi->fb.cmap.len) | ||
1797 | fb_dealloc_cmap(&fbi->fb.cmap); | ||
1798 | |||
1799 | irq = platform_get_irq(dev, 0); | ||
1800 | free_irq(irq, fbi); | ||
1801 | |||
1802 | dma_free_writecombine(&dev->dev, fbi->map_size, | ||
1803 | fbi->map_cpu, fbi->map_dma); | ||
1804 | |||
1805 | iounmap(fbi->mmio_base); | ||
1806 | |||
1807 | r = platform_get_resource(dev, IORESOURCE_MEM, 0); | ||
1808 | release_mem_region(r->start, r->end - r->start + 1); | ||
1809 | |||
1810 | clk_put(fbi->clk); | ||
1811 | kfree(fbi); | ||
1812 | |||
1813 | return 0; | ||
1814 | } | ||
1815 | |||
1780 | static struct platform_driver pxafb_driver = { | 1816 | static struct platform_driver pxafb_driver = { |
1781 | .probe = pxafb_probe, | 1817 | .probe = pxafb_probe, |
1818 | .remove = pxafb_remove, | ||
1782 | .suspend = pxafb_suspend, | 1819 | .suspend = pxafb_suspend, |
1783 | .resume = pxafb_resume, | 1820 | .resume = pxafb_resume, |
1784 | .driver = { | 1821 | .driver = { |
1822 | .owner = THIS_MODULE, | ||
1785 | .name = "pxa2xx-fb", | 1823 | .name = "pxa2xx-fb", |
1786 | }, | 1824 | }, |
1787 | }; | 1825 | }; |
@@ -1794,7 +1832,13 @@ static int __devinit pxafb_init(void) | |||
1794 | return platform_driver_register(&pxafb_driver); | 1832 | return platform_driver_register(&pxafb_driver); |
1795 | } | 1833 | } |
1796 | 1834 | ||
1835 | static void __exit pxafb_exit(void) | ||
1836 | { | ||
1837 | platform_driver_unregister(&pxafb_driver); | ||
1838 | } | ||
1839 | |||
1797 | module_init(pxafb_init); | 1840 | module_init(pxafb_init); |
1841 | module_exit(pxafb_exit); | ||
1798 | 1842 | ||
1799 | MODULE_DESCRIPTION("loadable framebuffer driver for PXA"); | 1843 | MODULE_DESCRIPTION("loadable framebuffer driver for PXA"); |
1800 | MODULE_LICENSE("GPL"); | 1844 | MODULE_LICENSE("GPL"); |