* [PATCH] video: nuc900fb: fix to pass correct device identity to free_irq()
@ 2013-07-12 13:20 Wei Yongjun
2013-07-15 2:41 ` Wan ZongShun
2013-07-16 0:07 ` [PATCH] video: nuc900fb: fix to pass correct device identity to request_irq() Wei Yongjun
0 siblings, 2 replies; 5+ messages in thread
From: Wei Yongjun @ 2013-07-12 13:20 UTC (permalink / raw)
To: linux-arm-kernel
From: Wei Yongjun <yongjun_wei@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@trendmicro.com.cn>
---
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);
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] video: nuc900fb: fix to pass correct device identity to free_irq()
2013-07-12 13:20 [PATCH] video: nuc900fb: fix to pass correct device identity to free_irq() Wei Yongjun
@ 2013-07-15 2:41 ` Wan ZongShun
2013-07-16 0:07 ` [PATCH] video: nuc900fb: fix to pass correct device identity to request_irq() Wei Yongjun
1 sibling, 0 replies; 5+ messages in thread
From: Wan ZongShun @ 2013-07-15 2:41 UTC (permalink / raw)
To: linux-arm-kernel
2013/7/12 Wei Yongjun <weiyj.lk@gmail.com>:
> From: Wei Yongjun <yongjun_wei@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@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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] video: nuc900fb: fix to pass correct device identity to request_irq()
2013-07-12 13:20 [PATCH] video: nuc900fb: fix to pass correct device identity to free_irq() Wei Yongjun
2013-07-15 2:41 ` Wan ZongShun
@ 2013-07-16 0:07 ` Wei Yongjun
2013-07-16 1:25 ` Wan ZongShun
2013-07-26 7:57 ` Tomi Valkeinen
1 sibling, 2 replies; 5+ messages in thread
From: Wei Yongjun @ 2013-07-16 0:07 UTC (permalink / raw)
To: linux-arm-kernel
The IRQ handler nuc900fb_irqhandler() use dev_id as a type of
struct nuc900fb_info *, so we should pass fbi as the device
identity to request_irq().
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
Was 'video: nuc900fb: fix to pass correct device identity to free_irq()'
---
drivers/video/nuc900fb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c
index 8c527e5..796e511 100644
--- a/drivers/video/nuc900fb.c
+++ b/drivers/video/nuc900fb.c
@@ -587,8 +587,7 @@ static int nuc900fb_probe(struct platform_device *pdev)
fbinfo->flags = FBINFO_FLAG_DEFAULT;
fbinfo->pseudo_palette = &fbi->pseudo_pal;
- ret = request_irq(irq, nuc900fb_irqhandler, 0,
- pdev->name, fbinfo);
+ ret = request_irq(irq, nuc900fb_irqhandler, 0, pdev->name, fbi);
if (ret) {
dev_err(&pdev->dev, "cannot register irq handler %d -err %d\n",
irq, ret);
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] video: nuc900fb: fix to pass correct device identity to request_irq()
2013-07-16 0:07 ` [PATCH] video: nuc900fb: fix to pass correct device identity to request_irq() Wei Yongjun
@ 2013-07-16 1:25 ` Wan ZongShun
2013-07-26 7:57 ` Tomi Valkeinen
1 sibling, 0 replies; 5+ messages in thread
From: Wan ZongShun @ 2013-07-16 1:25 UTC (permalink / raw)
To: linux-arm-kernel
2013/7/16 Wei Yongjun <weiyj.lk@gmail.com>:
> The IRQ handler nuc900fb_irqhandler() use dev_id as a type of
> struct nuc900fb_info *, so we should pass fbi as the device
> identity to request_irq().
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Wan Zongshun <mcuos.com@gmail.com>
Thanks!
Vincent Wan.
> ---
> Was 'video: nuc900fb: fix to pass correct device identity to free_irq()'
> ---
> drivers/video/nuc900fb.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c
> index 8c527e5..796e511 100644
> --- a/drivers/video/nuc900fb.c
> +++ b/drivers/video/nuc900fb.c
> @@ -587,8 +587,7 @@ static int nuc900fb_probe(struct platform_device *pdev)
> fbinfo->flags = FBINFO_FLAG_DEFAULT;
> fbinfo->pseudo_palette = &fbi->pseudo_pal;
>
> - ret = request_irq(irq, nuc900fb_irqhandler, 0,
> - pdev->name, fbinfo);
> + ret = request_irq(irq, nuc900fb_irqhandler, 0, pdev->name, fbi);
> if (ret) {
> dev_err(&pdev->dev, "cannot register irq handler %d -err %d\n",
> irq, ret);
>
>
--
Wan ZongShun.
www.mcuos.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] video: nuc900fb: fix to pass correct device identity to request_irq()
2013-07-16 0:07 ` [PATCH] video: nuc900fb: fix to pass correct device identity to request_irq() Wei Yongjun
2013-07-16 1:25 ` Wan ZongShun
@ 2013-07-26 7:57 ` Tomi Valkeinen
1 sibling, 0 replies; 5+ messages in thread
From: Tomi Valkeinen @ 2013-07-26 7:57 UTC (permalink / raw)
To: linux-arm-kernel
[-- Attachment #1: Type: text/plain, Size: 1126 bytes --]
On 16/07/13 03:07, Wei Yongjun wrote:
> The IRQ handler nuc900fb_irqhandler() use dev_id as a type of
> struct nuc900fb_info *, so we should pass fbi as the device
> identity to request_irq().
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
> Was 'video: nuc900fb: fix to pass correct device identity to free_irq()'
> ---
> drivers/video/nuc900fb.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c
> index 8c527e5..796e511 100644
> --- a/drivers/video/nuc900fb.c
> +++ b/drivers/video/nuc900fb.c
> @@ -587,8 +587,7 @@ static int nuc900fb_probe(struct platform_device *pdev)
> fbinfo->flags = FBINFO_FLAG_DEFAULT;
> fbinfo->pseudo_palette = &fbi->pseudo_pal;
>
> - ret = request_irq(irq, nuc900fb_irqhandler, 0,
> - pdev->name, fbinfo);
> + ret = request_irq(irq, nuc900fb_irqhandler, 0, pdev->name, fbi);
> if (ret) {
> dev_err(&pdev->dev, "cannot register irq handler %d -err %d\n",
> irq, ret);
>
Thanks, I've applied this into my 3.11-fixes/fbdev branch.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-07-26 7:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-12 13:20 [PATCH] video: nuc900fb: fix to pass correct device identity to free_irq() Wei Yongjun
2013-07-15 2:41 ` Wan ZongShun
2013-07-16 0:07 ` [PATCH] video: nuc900fb: fix to pass correct device identity to request_irq() Wei Yongjun
2013-07-16 1:25 ` Wan ZongShun
2013-07-26 7:57 ` Tomi Valkeinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).