Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753036AbcJKLne (ORCPT ); Tue, 11 Oct 2016 07:43:34 -0400 Received: from sci-ig2.spreadtrum.com ([222.66.158.135]:27429 "EHLO SHSQR01.spreadtrum.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752511AbcJKLna (ORCPT ); Tue, 11 Oct 2016 07:43:30 -0400 X-Greylist: delayed 1287 seconds by postgrey-1.27 at vger.kernel.org; Tue, 11 Oct 2016 07:43:28 EDT From: Orson Zhai To: , CC: , , , , , Orson Zhai Subject: [PATCH] clk: Register clkdev after setup of fixed-rate and fixed-factor clocks Date: Tue, 11 Oct 2016 19:13:44 +0800 Message-ID: <1476184424-8528-1-git-send-email-orson.zhai@spreadtrum.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-MAIL: SHSQR01.spreadtrum.com u9BBJ6bh033925 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1736 Lines: 64 From: Xiaolong Zhang When common kernel setups fixed clock, of_clk_provider will be registerred. But there is no clkdev being registerred at the same time. This will make it difficult to get the clock by using clk_get(NULL, con_id). Add clkdev register for fixed-rate and fixed-factor clock and ignore the error if any. Signed-off-by: Xiaolong Zhang Signed-off-by: Orson Zhai --- drivers/clk/clk-fixed-factor.c | 5 +++++ drivers/clk/clk-fixed-rate.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c index a5d402d..b81656a 100644 --- a/drivers/clk/clk-fixed-factor.c +++ b/drivers/clk/clk-fixed-factor.c @@ -9,6 +9,7 @@ */ #include #include +#include #include #include #include @@ -186,6 +187,10 @@ static struct clk *_of_fixed_factor_clk_setup(struct device_node *node) return ERR_PTR(ret); } +#ifdef CONFIG_CLKDEV_LOOKUP + clk_register_clkdev(clk, clk_name, 0); +#endif + return clk; } diff --git a/drivers/clk/clk-fixed-rate.c b/drivers/clk/clk-fixed-rate.c index b5c46b3..d42c8e7 100644 --- a/drivers/clk/clk-fixed-rate.c +++ b/drivers/clk/clk-fixed-rate.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include @@ -184,6 +185,10 @@ static struct clk *_of_fixed_clk_setup(struct device_node *node) return ERR_PTR(ret); } +#ifdef CONFIG_CLKDEV_LOOKUP + clk_register_clkdev(clk, clk_name, 0); +#endif + return clk; } -- 1.9.1