]> git.baikalelectronics.ru Git - kernel.git/commitdiff
video: fbdev: arcfb: add missed free_irq and fix the order of request_irq
authorChuhong Yuan <hslester96@gmail.com>
Tue, 24 Mar 2020 13:23:53 +0000 (21:23 +0800)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Fri, 17 Apr 2020 13:50:13 +0000 (15:50 +0200)
The driver forgets to free irq in remove which is requested in
probe.
Add the missed call to fix it.
Also, the position of request_irq() in probe should be put before
register_framebuffer().

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200324132353.21785-1-hslester96@gmail.com
drivers/video/fbdev/arcfb.c

index 314ab82e01c027503856d1e6fde3f1f94a6ae276..6f7838979f0a9463840d560512fab732bdd2cf22 100644 (file)
@@ -544,10 +544,6 @@ static int arcfb_probe(struct platform_device *dev)
        par->cslut[1] = 0x06;
        info->flags = FBINFO_FLAG_DEFAULT;
        spin_lock_init(&par->lock);
-       retval = register_framebuffer(info);
-       if (retval < 0)
-               goto err1;
-       platform_set_drvdata(dev, info);
        if (irq) {
                par->irq = irq;
                if (request_irq(par->irq, &arcfb_interrupt, IRQF_SHARED,
@@ -558,6 +554,10 @@ static int arcfb_probe(struct platform_device *dev)
                        goto err1;
                }
        }
+       retval = register_framebuffer(info);
+       if (retval < 0)
+               goto err1;
+       platform_set_drvdata(dev, info);
        fb_info(info, "Arc frame buffer device, using %dK of video memory\n",
                videomemorysize >> 10);
 
@@ -593,6 +593,8 @@ static int arcfb_remove(struct platform_device *dev)
 
        if (info) {
                unregister_framebuffer(info);
+               if (irq)
+                       free_irq(((struct arcfb_par *)(info->par))->irq, info);
                vfree((void __force *)info->screen_base);
                framebuffer_release(info);
        }