From: marek.vasut@gmail.com (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pxa168fb: Add .remove function
Date: Mon, 30 Aug 2010 19:43:47 +0200 [thread overview]
Message-ID: <201008301943.48077.marek.vasut@gmail.com> (raw)
In-Reply-To: <1283128337-4605-1-git-send-email-haojian.zhuang@marvell.com>
Dne Po 30. srpna 2010 02:32:16 Haojian Zhuang napsal(a):
> The pxa168fb driver is missing .remove function so the framebuffer isn't
> correctly shut down when the module is removed.
>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
> ---
> drivers/video/pxa168fb.c | 47
> ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 47
> insertions(+), 0 deletions(-)
>
> diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c
> index c91a7f7..ec2ddb2 100644
> --- a/drivers/video/pxa168fb.c
> +++ b/drivers/video/pxa168fb.c
> @@ -784,12 +784,53 @@ failed:
> 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);
> +
Haojian, is this line below correct?
If so, for this modified version, find my:
Acked-by: Marek Vasut <marek.vasut@gmail.com>
> + 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 = {
> .driver = {
> .name = "pxa168-fb",
> .owner = THIS_MODULE,
> },
> .probe = pxa168fb_probe,
> + .remove = __devexit_p(pxa168fb_remove),
> };
>
> static int __devinit pxa168fb_init(void)
> @@ -798,6 +839,12 @@ static int __devinit pxa168fb_init(void)
> }
> 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> "
> "Green Wan <gwan@marvell.com>");
> MODULE_DESCRIPTION("Framebuffer driver for PXA168/910");
next prev parent reply other threads:[~2010-08-30 17:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-30 0:32 [PATCH] pxa168fb: Add .remove function Haojian Zhuang
2010-08-30 0:32 ` [PATCH] pxa168fb: fix clear operation Haojian Zhuang
2010-08-30 17:44 ` Marek Vasut
2010-09-05 11:56 ` Eric Miao
2010-09-06 11:26 ` Haojian Zhuang
2010-09-07 2:23 ` Eric Miao
2010-08-30 17:43 ` Marek Vasut [this message]
2010-09-05 11:08 ` [PATCH] pxa168fb: Add .remove function Eric Miao
-- strict thread matches above, loose matches on Subject: below --
2010-08-29 11:17 Marek Vasut
2010-08-30 13:16 ` Haojian Zhuang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201008301943.48077.marek.vasut@gmail.com \
--to=marek.vasut@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.