From 54bbddc7fced8573ad06ed46f44a7627f4626b22 Mon Sep 17 00:00:00 2001 From: Evoke Zhang Date: Mon, 26 Feb 2018 15:05:15 +0800 Subject: [PATCH] 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 --- drivers/amlogic/media/common/vpu/vpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.7.4