Commit 9f17f287 authored by Jaya Kumar's avatar Jaya Kumar Committed by Russell King

[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: default avatarJaya Kumar <jayakumar.lkml@gmail.com>
Acked-by: default avatarKrzysztof Helt <krzysztof.h1@wp.pl>
Acked-by: default avatarEric Miao <eric.miao@marvell.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 5a2cc50f
...@@ -1777,11 +1777,49 @@ static int __init pxafb_probe(struct platform_device *dev) ...@@ -1777,11 +1777,49 @@ static int __init pxafb_probe(struct platform_device *dev)
return ret; return ret;
} }
static int __devexit pxafb_remove(struct platform_device *dev)
{
struct pxafb_info *fbi = platform_get_drvdata(dev);
struct resource *r;
int irq;
struct fb_info *info;
if (!fbi)
return 0;
info = &fbi->fb;
unregister_framebuffer(info);
pxafb_disable_controller(fbi);
if (fbi->fb.cmap.len)
fb_dealloc_cmap(&fbi->fb.cmap);
irq = platform_get_irq(dev, 0);
free_irq(irq, fbi);
dma_free_writecombine(&dev->dev, fbi->map_size,
fbi->map_cpu, fbi->map_dma);
iounmap(fbi->mmio_base);
r = platform_get_resource(dev, IORESOURCE_MEM, 0);
release_mem_region(r->start, r->end - r->start + 1);
clk_put(fbi->clk);
kfree(fbi);
return 0;
}
static struct platform_driver pxafb_driver = { static struct platform_driver pxafb_driver = {
.probe = pxafb_probe, .probe = pxafb_probe,
.remove = pxafb_remove,
.suspend = pxafb_suspend, .suspend = pxafb_suspend,
.resume = pxafb_resume, .resume = pxafb_resume,
.driver = { .driver = {
.owner = THIS_MODULE,
.name = "pxa2xx-fb", .name = "pxa2xx-fb",
}, },
}; };
...@@ -1794,7 +1832,13 @@ static int __devinit pxafb_init(void) ...@@ -1794,7 +1832,13 @@ static int __devinit pxafb_init(void)
return platform_driver_register(&pxafb_driver); return platform_driver_register(&pxafb_driver);
} }
static void __exit pxafb_exit(void)
{
platform_driver_unregister(&pxafb_driver);
}
module_init(pxafb_init); module_init(pxafb_init);
module_exit(pxafb_exit);
MODULE_DESCRIPTION("loadable framebuffer driver for PXA"); MODULE_DESCRIPTION("loadable framebuffer driver for PXA");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment