Commit 3c1e7f27 authored by Alexander Shiyan's avatar Alexander Shiyan Committed by Mauro Carvalho Chehab

[media] m2m-deinterlace: Convert to devm* API

Replace resource handling in the driver with managed device resource.
Signed-off-by: default avatarAlexander Shiyan <shc_work@mail.ru>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent ebdae650
...@@ -1002,7 +1002,7 @@ static int deinterlace_probe(struct platform_device *pdev) ...@@ -1002,7 +1002,7 @@ static int deinterlace_probe(struct platform_device *pdev)
dma_cap_mask_t mask; dma_cap_mask_t mask;
int ret = 0; int ret = 0;
pcdev = kzalloc(sizeof *pcdev, GFP_KERNEL); pcdev = devm_kzalloc(&pdev->dev, sizeof(*pcdev), GFP_KERNEL);
if (!pcdev) if (!pcdev)
return -ENOMEM; return -ENOMEM;
...@@ -1012,7 +1012,7 @@ static int deinterlace_probe(struct platform_device *pdev) ...@@ -1012,7 +1012,7 @@ static int deinterlace_probe(struct platform_device *pdev)
dma_cap_set(DMA_INTERLEAVE, mask); dma_cap_set(DMA_INTERLEAVE, mask);
pcdev->dma_chan = dma_request_channel(mask, NULL, pcdev); pcdev->dma_chan = dma_request_channel(mask, NULL, pcdev);
if (!pcdev->dma_chan) if (!pcdev->dma_chan)
goto free_dev; return -ENODEV;
if (!dma_has_cap(DMA_INTERLEAVE, pcdev->dma_chan->device->cap_mask)) { if (!dma_has_cap(DMA_INTERLEAVE, pcdev->dma_chan->device->cap_mask)) {
v4l2_err(&pcdev->v4l2_dev, "DMA does not support INTERLEAVE\n"); v4l2_err(&pcdev->v4l2_dev, "DMA does not support INTERLEAVE\n");
...@@ -1078,8 +1078,6 @@ static int deinterlace_probe(struct platform_device *pdev) ...@@ -1078,8 +1078,6 @@ static int deinterlace_probe(struct platform_device *pdev)
v4l2_device_unregister(&pcdev->v4l2_dev); v4l2_device_unregister(&pcdev->v4l2_dev);
rel_dma: rel_dma:
dma_release_channel(pcdev->dma_chan); dma_release_channel(pcdev->dma_chan);
free_dev:
kfree(pcdev);
return ret; return ret;
} }
...@@ -1094,7 +1092,6 @@ static int deinterlace_remove(struct platform_device *pdev) ...@@ -1094,7 +1092,6 @@ static int deinterlace_remove(struct platform_device *pdev)
v4l2_device_unregister(&pcdev->v4l2_dev); v4l2_device_unregister(&pcdev->v4l2_dev);
vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx); vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
dma_release_channel(pcdev->dma_chan); dma_release_channel(pcdev->dma_chan);
kfree(pcdev);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment