aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLad, Prabhakar <prabhakar.csengg@gmail.com>2013-06-17 10:20:50 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-21 10:28:09 -0400
commit9c63e01e2b671c2810b8fbc94278a2c3c1f0491c (patch)
tree8a0cf7a9ddf7eb74a9d4cca087ae615d7cf31e45
parentb8d067b601696f303c6623c7c1c4b7cd6e2c8321 (diff)
[media] media: davinci: vpif_display: Convert to devm_* api
use devm_request_irq() instead of request_irq(). This ensures more consistent error values and simplifies error paths. Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/platform/davinci/vpif_display.c35
1 files changed, 10 insertions, 25 deletions
diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c
index 473d1a9dd1af..1bf289d64343 100644
--- a/drivers/media/platform/davinci/vpif_display.c
+++ b/drivers/media/platform/davinci/vpif_display.c
@@ -1652,15 +1652,14 @@ static __init int vpif_probe(struct platform_device *pdev)
1652 1652
1653 while ((res = platform_get_resource(pdev, IORESOURCE_IRQ, res_idx))) { 1653 while ((res = platform_get_resource(pdev, IORESOURCE_IRQ, res_idx))) {
1654 for (i = res->start; i <= res->end; i++) { 1654 for (i = res->start; i <= res->end; i++) {
1655 if (request_irq(i, vpif_channel_isr, IRQF_SHARED, 1655 err = devm_request_irq(&pdev->dev, i, vpif_channel_isr,
1656 "VPIF_Display", (void *) 1656 IRQF_SHARED, "VPIF_Display",
1657 (&vpif_obj.dev[res_idx]->channel_id))) { 1657 (void *)(&vpif_obj.dev[res_idx]->
1658 err = -EBUSY; 1658 channel_id));
1659 for (j = 0; j < i; j++) 1659 if (err) {
1660 free_irq(j, (void *) 1660 err = -EINVAL;
1661 (&vpif_obj.dev[res_idx]->channel_id));
1662 vpif_err("VPIF IRQ request failed\n"); 1661 vpif_err("VPIF IRQ request failed\n");
1663 goto vpif_int_err; 1662 goto vpif_unregister;
1664 } 1663 }
1665 } 1664 }
1666 res_idx++; 1665 res_idx++;
@@ -1678,7 +1677,7 @@ static __init int vpif_probe(struct platform_device *pdev)
1678 video_device_release(ch->video_dev); 1677 video_device_release(ch->video_dev);
1679 } 1678 }
1680 err = -ENOMEM; 1679 err = -ENOMEM;
1681 goto vpif_int_err; 1680 goto vpif_unregister;
1682 } 1681 }
1683 1682
1684 /* Initialize field of video device */ 1683 /* Initialize field of video device */
@@ -1812,13 +1811,8 @@ vpif_sd_error:
1812 /* Note: does nothing if ch->video_dev == NULL */ 1811 /* Note: does nothing if ch->video_dev == NULL */
1813 video_device_release(ch->video_dev); 1812 video_device_release(ch->video_dev);
1814 } 1813 }
1815vpif_int_err: 1814vpif_unregister:
1816 v4l2_device_unregister(&vpif_obj.v4l2_dev); 1815 v4l2_device_unregister(&vpif_obj.v4l2_dev);
1817 for (i = 0; i < res_idx; i++) {
1818 res = platform_get_resource(pdev, IORESOURCE_IRQ, i);
1819 for (j = res->start; j <= res->end; j++)
1820 free_irq(j, (void *)(&vpif_obj.dev[i]->channel_id));
1821 }
1822 1816
1823 return err; 1817 return err;
1824} 1818}
@@ -1829,16 +1823,7 @@ vpif_int_err:
1829static int vpif_remove(struct platform_device *device) 1823static int vpif_remove(struct platform_device *device)
1830{ 1824{
1831 struct channel_obj *ch; 1825 struct channel_obj *ch;
1832 struct resource *res; 1826 int i;
1833 int irq_num;
1834 int i = 0;
1835
1836 while ((res = platform_get_resource(device, IORESOURCE_IRQ, i))) {
1837 for (irq_num = res->start; irq_num <= res->end; irq_num++)
1838 free_irq(irq_num,
1839 (void *)(&vpif_obj.dev[i]->channel_id));
1840 i++;
1841 }
1842 1827
1843 v4l2_device_unregister(&vpif_obj.v4l2_dev); 1828 v4l2_device_unregister(&vpif_obj.v4l2_dev);
1844 1829