aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2014-05-24 01:03:16 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-06-17 11:04:46 -0400
commit3c1e7f27561038d683f519a5fb723743e7b8e83b (patch)
treebdd087421bba9242d3d6b98681a045d8719fa1fc
parentebdae6507b00c77f51b0c3ef70d25f65699f5644 (diff)
[media] m2m-deinterlace: Convert to devm* API
Replace resource handling in the driver with managed device resource. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/platform/m2m-deinterlace.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c
index c21d14fd61db..d36c507a0ba2 100644
--- a/drivers/media/platform/m2m-deinterlace.c
+++ b/drivers/media/platform/m2m-deinterlace.c
@@ -1002,7 +1002,7 @@ static int deinterlace_probe(struct platform_device *pdev)
1002 dma_cap_mask_t mask; 1002 dma_cap_mask_t mask;
1003 int ret = 0; 1003 int ret = 0;
1004 1004
1005 pcdev = kzalloc(sizeof *pcdev, GFP_KERNEL); 1005 pcdev = devm_kzalloc(&pdev->dev, sizeof(*pcdev), GFP_KERNEL);
1006 if (!pcdev) 1006 if (!pcdev)
1007 return -ENOMEM; 1007 return -ENOMEM;
1008 1008
@@ -1012,7 +1012,7 @@ static int deinterlace_probe(struct platform_device *pdev)
1012 dma_cap_set(DMA_INTERLEAVE, mask); 1012 dma_cap_set(DMA_INTERLEAVE, mask);
1013 pcdev->dma_chan = dma_request_channel(mask, NULL, pcdev); 1013 pcdev->dma_chan = dma_request_channel(mask, NULL, pcdev);
1014 if (!pcdev->dma_chan) 1014 if (!pcdev->dma_chan)
1015 goto free_dev; 1015 return -ENODEV;
1016 1016
1017 if (!dma_has_cap(DMA_INTERLEAVE, pcdev->dma_chan->device->cap_mask)) { 1017 if (!dma_has_cap(DMA_INTERLEAVE, pcdev->dma_chan->device->cap_mask)) {
1018 v4l2_err(&pcdev->v4l2_dev, "DMA does not support INTERLEAVE\n"); 1018 v4l2_err(&pcdev->v4l2_dev, "DMA does not support INTERLEAVE\n");
@@ -1078,8 +1078,6 @@ unreg_dev:
1078 v4l2_device_unregister(&pcdev->v4l2_dev); 1078 v4l2_device_unregister(&pcdev->v4l2_dev);
1079rel_dma: 1079rel_dma:
1080 dma_release_channel(pcdev->dma_chan); 1080 dma_release_channel(pcdev->dma_chan);
1081free_dev:
1082 kfree(pcdev);
1083 1081
1084 return ret; 1082 return ret;
1085} 1083}
@@ -1094,7 +1092,6 @@ static int deinterlace_remove(struct platform_device *pdev)
1094 v4l2_device_unregister(&pcdev->v4l2_dev); 1092 v4l2_device_unregister(&pcdev->v4l2_dev);
1095 vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx); 1093 vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
1096 dma_release_channel(pcdev->dma_chan); 1094 dma_release_channel(pcdev->dma_chan);
1097 kfree(pcdev);
1098 1095
1099 return 0; 1096 return 0;
1100} 1097}