From: Evoke Zhang Date: Mon, 26 Feb 2018 07:05:15 +0000 (+0800) Subject: vpu: optimize get_vpu_clk with clktree api X-Git-Tag: khadas-vims-v0.9.6-release~2507 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=54bbddc7fced8573ad06ed46f44a7627f4626b22;p=platform%2Fkernel%2Flinux-amlogic.git vpu: optimize get_vpu_clk with clktree api PD#156734: vpu: optimize get_vpu_clk with clktree api use clk_hw_get_rate instead of clk_get_rate. Change-Id: Ib2d72c04d4df9acbacf06d189bbbce378f582716 Signed-off-by: Evoke Zhang --- diff --git a/drivers/amlogic/media/common/vpu/vpu.c b/drivers/amlogic/media/common/vpu/vpu.c index 0323231..6ee49c2 100644 --- a/drivers/amlogic/media/common/vpu/vpu.c +++ b/drivers/amlogic/media/common/vpu/vpu.c @@ -149,6 +149,7 @@ unsigned int get_vpu_clk(void) unsigned int clk_freq; unsigned int clk_source, div; unsigned int mux_id; + struct clk_hw *hw; if (IS_ERR_OR_NULL(vpu_conf.vpu_clk)) { VPUERR("%s: vpu_clk\n", __func__); @@ -174,7 +175,8 @@ unsigned int get_vpu_clk(void) return clk_freq; } - clk_freq = clk_get_rate(vpu_conf.vpu_clk); + hw = __clk_get_hw(vpu_conf.vpu_clk); + clk_freq = clk_hw_get_rate(hw); return clk_freq; }