aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s5p-g2d/g2d.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/s5p-g2d/g2d.c')
-rw-r--r--drivers/media/video/s5p-g2d/g2d.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/media/video/s5p-g2d/g2d.c b/drivers/media/video/s5p-g2d/g2d.c
index febaa673d363..351080a217fe 100644
--- a/drivers/media/video/s5p-g2d/g2d.c
+++ b/drivers/media/video/s5p-g2d/g2d.c
@@ -693,18 +693,30 @@ static int g2d_probe(struct platform_device *pdev)
693 goto unmap_regs; 693 goto unmap_regs;
694 } 694 }
695 695
696 ret = clk_prepare(dev->clk);
697 if (ret) {
698 dev_err(&pdev->dev, "failed to prepare g2d clock\n");
699 goto put_clk;
700 }
701
696 dev->gate = clk_get(&pdev->dev, "fimg2d"); 702 dev->gate = clk_get(&pdev->dev, "fimg2d");
697 if (IS_ERR_OR_NULL(dev->gate)) { 703 if (IS_ERR_OR_NULL(dev->gate)) {
698 dev_err(&pdev->dev, "failed to get g2d clock gate\n"); 704 dev_err(&pdev->dev, "failed to get g2d clock gate\n");
699 ret = -ENXIO; 705 ret = -ENXIO;
700 goto put_clk; 706 goto unprep_clk;
707 }
708
709 ret = clk_prepare(dev->gate);
710 if (ret) {
711 dev_err(&pdev->dev, "failed to prepare g2d clock gate\n");
712 goto put_clk_gate;
701 } 713 }
702 714
703 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 715 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
704 if (!res) { 716 if (!res) {
705 dev_err(&pdev->dev, "failed to find IRQ\n"); 717 dev_err(&pdev->dev, "failed to find IRQ\n");
706 ret = -ENXIO; 718 ret = -ENXIO;
707 goto put_clk_gate; 719 goto unprep_clk_gate;
708 } 720 }
709 721
710 dev->irq = res->start; 722 dev->irq = res->start;
@@ -764,8 +776,12 @@ alloc_ctx_cleanup:
764 vb2_dma_contig_cleanup_ctx(dev->alloc_ctx); 776 vb2_dma_contig_cleanup_ctx(dev->alloc_ctx);
765rel_irq: 777rel_irq:
766 free_irq(dev->irq, dev); 778 free_irq(dev->irq, dev);
779unprep_clk_gate:
780 clk_unprepare(dev->gate);
767put_clk_gate: 781put_clk_gate:
768 clk_put(dev->gate); 782 clk_put(dev->gate);
783unprep_clk:
784 clk_unprepare(dev->clk);
769put_clk: 785put_clk:
770 clk_put(dev->clk); 786 clk_put(dev->clk);
771unmap_regs: 787unmap_regs:
@@ -787,7 +803,9 @@ static int g2d_remove(struct platform_device *pdev)
787 v4l2_device_unregister(&dev->v4l2_dev); 803 v4l2_device_unregister(&dev->v4l2_dev);
788 vb2_dma_contig_cleanup_ctx(dev->alloc_ctx); 804 vb2_dma_contig_cleanup_ctx(dev->alloc_ctx);
789 free_irq(dev->irq, dev); 805 free_irq(dev->irq, dev);
806 clk_unprepare(dev->gate);
790 clk_put(dev->gate); 807 clk_put(dev->gate);
808 clk_unprepare(dev->clk);
791 clk_put(dev->clk); 809 clk_put(dev->clk);
792 iounmap(dev->regs); 810 iounmap(dev->regs);
793 release_resource(dev->res_regs); 811 release_resource(dev->res_regs);