aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/dss.c
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2013-04-08 04:55:00 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-10 08:02:54 -0400
commitb2c9c8ee7cec4c7d8fa90375f9de92ecf3045ebb (patch)
tree33b24a8d65318bcbaa6036410a7715af283f39d1 /drivers/video/omap2/dss/dss.c
parent3aff5b122b7e01945ba787df306c182bae9f6762 (diff)
omapdss: use devm_clk_get()
Use devm_clk_get() instead of clk_get() for dss, and for outputs hdmi and venc. This reduces code and simplifies error handling. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/dss.c')
-rw-r--r--drivers/video/omap2/dss/dss.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 054c2a22b3f1..645b3bc12ede 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -767,13 +767,11 @@ int dss_dpi_select_source(enum omap_channel channel)
767static int dss_get_clocks(void) 767static int dss_get_clocks(void)
768{ 768{
769 struct clk *clk; 769 struct clk *clk;
770 int r;
771 770
772 clk = clk_get(&dss.pdev->dev, "fck"); 771 clk = devm_clk_get(&dss.pdev->dev, "fck");
773 if (IS_ERR(clk)) { 772 if (IS_ERR(clk)) {
774 DSSERR("can't get clock fck\n"); 773 DSSERR("can't get clock fck\n");
775 r = PTR_ERR(clk); 774 return PTR_ERR(clk);
776 goto err;
777 } 775 }
778 776
779 dss.dss_clk = clk; 777 dss.dss_clk = clk;
@@ -782,8 +780,7 @@ static int dss_get_clocks(void)
782 clk = clk_get(NULL, dss.feat->clk_name); 780 clk = clk_get(NULL, dss.feat->clk_name);
783 if (IS_ERR(clk)) { 781 if (IS_ERR(clk)) {
784 DSSERR("Failed to get %s\n", dss.feat->clk_name); 782 DSSERR("Failed to get %s\n", dss.feat->clk_name);
785 r = PTR_ERR(clk); 783 return PTR_ERR(clk);
786 goto err;
787 } 784 }
788 } else { 785 } else {
789 clk = NULL; 786 clk = NULL;
@@ -792,21 +789,12 @@ static int dss_get_clocks(void)
792 dss.dpll4_m4_ck = clk; 789 dss.dpll4_m4_ck = clk;
793 790
794 return 0; 791 return 0;
795
796err:
797 if (dss.dss_clk)
798 clk_put(dss.dss_clk);
799 if (dss.dpll4_m4_ck)
800 clk_put(dss.dpll4_m4_ck);
801
802 return r;
803} 792}
804 793
805static void dss_put_clocks(void) 794static void dss_put_clocks(void)
806{ 795{
807 if (dss.dpll4_m4_ck) 796 if (dss.dpll4_m4_ck)
808 clk_put(dss.dpll4_m4_ck); 797 clk_put(dss.dpll4_m4_ck);
809 clk_put(dss.dss_clk);
810} 798}
811 799
812static int dss_runtime_get(void) 800static int dss_runtime_get(void)