[PATCH] video: nuc900fb: fix to pass correct device identity to free_irq()
Wan ZongShun
mcuos.com at gmail.com
Sun Jul 14 22:41:45 EDT 2013
2013/7/12 Wei Yongjun <weiyj.lk at gmail.com>:
> From: Wei Yongjun <yongjun_wei at trendmicro.com.cn>
>
> free_irq() expects the same device identity that was passed to
> corresponding request_irq(), otherwise the IRQ is not freed.
>
> Signed-off-by: Wei Yongjun <yongjun_wei at trendmicro.com.cn>
Sorry, repost.
Hi Yongjun,
(1) ret = request_irq(irq, nuc900fb_irqhandler, 0,
pdev->name, fbinfo);
(2) static irqreturn_t nuc900fb_irqhandler(int irq, void *dev_id)
{
struct nuc900fb_info *fbi = dev_id;
void __iomem *regs = fbi->io;
>From (1) and (2), we should consider the wrong with passing 'fbinfo'
to 'nuc900fb_irqhandler', it should pass the 'fbi' instead as
following codes:
ret = request_irq(irq, nuc900fb_irqhandler, 0,
pdev->name, fbi);
So if we fix this wrong,' free_irq(irq, fbi);' would be ok, right?
Thanks!
Vincent Wan.
> ---
> drivers/video/nuc900fb.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c
> index 8c527e5..ebd5501 100644
> --- a/drivers/video/nuc900fb.c
> +++ b/drivers/video/nuc900fb.c
> @@ -661,7 +661,7 @@ release_clock:
> clk_disable(fbi->clk);
> clk_put(fbi->clk);
> release_irq:
> - free_irq(irq, fbi);
> + free_irq(irq, fbinfo);
> release_regs:
> iounmap(fbi->io);
> release_mem_region:
> @@ -702,7 +702,7 @@ static int nuc900fb_remove(struct platform_device *pdev)
> iounmap(fbi->io);
>
> irq = platform_get_irq(pdev, 0);
> - free_irq(irq, fbi);
> + free_irq(irq, fbinfo);
>
> release_resource(fbi->mem);
> kfree(fbi->mem);
>
--
Wan ZongShun.
www.mcuos.com
More information about the linux-arm-kernel
mailing list