staging: media: omap1: Replace request_irq with devm_request_irq
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>
Tue, 22 Mar 2016 16:53:02 +0000 (22:23 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
Replace request_irq with devm_request_irq to get the interrupt
for device which is automatically freed on exit. Remove
corresponding free_irq from probe and remove functions of a
platform device.

Also, remove an unnecessary label.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/omap1/omap1_camera.c

index c4450b4..54b8dd2 100644 (file)
@@ -1640,7 +1640,8 @@ static int omap1_cam_probe(struct platform_device *pdev)
        /* setup DMA autoinitialization */
        omap_dma_link_lch(pcdev->dma_ch, pcdev->dma_ch);
 
-       err = request_irq(pcdev->irq, cam_isr, 0, DRIVER_NAME, pcdev);
+       err = devm_request_irq(&pdev->dev, pcdev->irq, cam_isr, 0, DRIVER_NAME,
+                              pcdev);
        if (err) {
                dev_err(&pdev->dev, "Camera interrupt register failed\n");
                goto exit_free_dma;
@@ -1654,14 +1655,12 @@ static int omap1_cam_probe(struct platform_device *pdev)
 
        err = soc_camera_host_register(&pcdev->soc_host);
        if (err)
-               goto exit_free_irq;
+               return err;
 
        dev_info(&pdev->dev, "OMAP1 Camera Interface driver loaded\n");
 
        return 0;
 
-exit_free_irq:
-       free_irq(pcdev->irq, pcdev);
 exit_free_dma:
        omap_free_dma(pcdev->dma_ch);
 exit:
@@ -1674,8 +1673,6 @@ static int omap1_cam_remove(struct platform_device *pdev)
        struct omap1_cam_dev *pcdev = container_of(soc_host,
                                        struct omap1_cam_dev, soc_host);
 
-       free_irq(pcdev->irq, pcdev);
-
        omap_free_dma(pcdev->dma_ch);
 
        soc_camera_host_unregister(soc_host);