From patchwork Mon Nov 19 16:52:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1766191 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 9D1CFDF264 for ; Mon, 19 Nov 2012 16:56:16 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TaUbM-00036f-DS; Mon, 19 Nov 2012 16:53:41 +0000 Received: from mail.free-electrons.com ([88.190.12.23]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TaUap-0002x4-UT for linux-arm-kernel@lists.infradead.org; Mon, 19 Nov 2012 16:53:10 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id A653A2AB; Mon, 19 Nov 2012 17:52:56 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham version=3.3.1 Received: from localhost (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id 187AF180; Mon, 19 Nov 2012 17:52:40 +0100 (CET) From: Thomas Petazzoni To: Andrew Lunn Subject: [PATCH 2/7] clk: mvebu: move clk-cpu compatible strings into the clk-cpu driver Date: Mon, 19 Nov 2012 17:52:38 +0100 Message-Id: <1353343963-23034-3-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1353343963-23034-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1353343963-23034-1-git-send-email-thomas.petazzoni@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121119_115308_239245_353AA9B2 X-CRM114-Status: GOOD ( 14.82 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Gregory Clement , Lior Amsalem , Jason Cooper , linux-arm-kernel@lists.infradead.org, Maen Suleiman X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Both the clk-core and clk-gating drivers define their compatible string in their own .c file and provide an initialization function to register the clock types. clk-cpu was not doing the same: it was defining its compatible string directly in clk.c, and calling of_clk_init() from here. For consistency reasons, this patch moves the clk-cpu compatible string in clk-cpu.c, and implements a proper mvebu_cpu_clk_init() function like the other two clock drivers. Signed-off-by: Thomas Petazzoni --- drivers/clk/mvebu/clk-cpu.c | 15 +++++++++++++++ drivers/clk/mvebu/clk-cpu.h | 6 +++++- drivers/clk/mvebu/clk.c | 14 +------------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/drivers/clk/mvebu/clk-cpu.c b/drivers/clk/mvebu/clk-cpu.c index 1df027a..3d7c9f1 100644 --- a/drivers/clk/mvebu/clk-cpu.c +++ b/drivers/clk/mvebu/clk-cpu.c @@ -153,3 +153,18 @@ bail_out: kfree(clks); kfree(cpuclk); } + +static const __initconst struct of_device_id clk_cpu_match[] = { + { + .compatible = "marvell,armada-xp-cpu-clockctrl", + .data = of_cpu_clk_setup, + }, + { + /* sentinel */ + }, +}; + +void __init mvebu_cpu_clk_init(void) +{ + of_clk_init(clk_cpu_match); +} diff --git a/drivers/clk/mvebu/clk-cpu.h b/drivers/clk/mvebu/clk-cpu.h index e208336..08e2aff 100644 --- a/drivers/clk/mvebu/clk-cpu.h +++ b/drivers/clk/mvebu/clk-cpu.h @@ -13,6 +13,10 @@ #ifndef __MVEBU_CLK_CPU_H #define __MVEBU_CLK_CPU_H -void __init of_cpu_clk_setup(struct device_node *node); +#ifdef CONFIG_MVEBU_CLK_CPU +void __init mvebu_cpu_clk_init(void); +#else +static inline void mvebu_cpu_clk_init(void) {} +#endif #endif diff --git a/drivers/clk/mvebu/clk.c b/drivers/clk/mvebu/clk.c index 3f0e43e..e3bc036 100644 --- a/drivers/clk/mvebu/clk.c +++ b/drivers/clk/mvebu/clk.c @@ -19,21 +19,9 @@ #include "clk-cpu.h" #include "clk-gating-ctrl.h" -static const __initconst struct of_device_id clk_match[] = { -#ifdef CONFIG_MVEBU_CLK_CPU - { - .compatible = "marvell,armada-xp-cpu-clockctrl", - .data = of_cpu_clk_setup, - }, -#endif - { - /* sentinel */ - } -}; - void __init mvebu_clocks_init(void) { mvebu_core_clk_init(); mvebu_clk_gating_init(); - of_clk_init(clk_match); + mvebu_cpu_clk_init(); }