From patchwork Tue Jul 9 06:42:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Zhang X-Patchwork-Id: 2825121 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A17309F756 for ; Tue, 9 Jul 2013 07:20:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55D962013A for ; Tue, 9 Jul 2013 07:20:02 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 378852011E for ; Tue, 9 Jul 2013 07:20:01 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UwRgJ-0005Ny-D2; Tue, 09 Jul 2013 06:45:48 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UwRfW-0007hL-Sk; Tue, 09 Jul 2013 06:44:58 +0000 Received: from na3sys009aog101.obsmtp.com ([74.125.149.67]) by merlin.infradead.org with smtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UwRfT-0007gP-NS for linux-arm-kernel@lists.infradead.org; Tue, 09 Jul 2013 06:44:56 +0000 Received: from SC-OWA01.marvell.com ([199.233.58.136]) (using TLSv1) by na3sys009aob101.postini.com ([74.125.148.12]) with SMTP ID DSNKUduxSZFdZohn/keBcO5Ck3OFL8JC6BY8@postini.com; Mon, 08 Jul 2013 23:44:55 PDT Received: from maili.marvell.com (10.93.76.43) by sc-owa01.marvell.com (10.93.76.21) with Microsoft SMTP Server id 8.3.213.0; Mon, 8 Jul 2013 23:42:51 -0700 Received: from localhost (unknown [10.38.164.239]) by maili.marvell.com (Postfix) with ESMTP id 4764B1CCD9C; Mon, 8 Jul 2013 23:42:51 -0700 (PDT) From: Neil Zhang To: , , , , , Subject: [PATCH V3 2/3] clocksource: mmp: support CLOCKSOURCE OF DECLARE Date: Tue, 9 Jul 2013 14:42:45 +0800 Message-ID: <1373352166-10064-3-git-send-email-zhangwm@marvell.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1373352166-10064-1-git-send-email-zhangwm@marvell.com> References: <1373352166-10064-1-git-send-email-zhangwm@marvell.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130709_024455_891668_1E1D53ED X-CRM114-Status: GOOD ( 10.97 ) X-Spam-Score: -4.2 (----) Cc: Neil Zhang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP support CLOCKSOURCE OF DECLARE for mmp timer. Signed-off-by: Neil Zhang --- arch/arm/mach-mmp/mmp-dt.c | 5 ++--- arch/arm/mach-mmp/mmp2-dt.c | 3 +-- arch/arm/mach-mmp/time.c | 15 ++------------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/arch/arm/mach-mmp/mmp-dt.c b/arch/arm/mach-mmp/mmp-dt.c index 62c5adb..87ab5ff 100644 --- a/arch/arm/mach-mmp/mmp-dt.c +++ b/arch/arm/mach-mmp/mmp-dt.c @@ -20,7 +20,6 @@ #include "common.h" extern void __init mmp_dt_irq_init(void); -extern void __init mmp_dt_init_timer(void); static const struct of_dev_auxdata pxa168_auxdata_lookup[] __initconst = { OF_DEV_AUXDATA("marvell,mmp-uart", 0xd4017000, "pxa2xx-uart.0", NULL), @@ -65,7 +64,7 @@ static const char *mmp_dt_board_compat[] __initdata = { DT_MACHINE_START(PXA168_DT, "Marvell PXA168 (Device Tree Support)") .map_io = mmp_map_io, .init_irq = mmp_dt_irq_init, - .init_time = mmp_dt_init_timer, + .init_time = clocksource_of_init, .init_machine = pxa168_dt_init, .dt_compat = mmp_dt_board_compat, MACHINE_END @@ -73,7 +72,7 @@ MACHINE_END DT_MACHINE_START(PXA910_DT, "Marvell PXA910 (Device Tree Support)") .map_io = mmp_map_io, .init_irq = mmp_dt_irq_init, - .init_time = mmp_dt_init_timer, + .init_time = clocksource_of_init, .init_machine = pxa910_dt_init, .dt_compat = mmp_dt_board_compat, MACHINE_END diff --git a/arch/arm/mach-mmp/mmp2-dt.c b/arch/arm/mach-mmp/mmp2-dt.c index 6523ecf..0ce46f1 100644 --- a/arch/arm/mach-mmp/mmp2-dt.c +++ b/arch/arm/mach-mmp/mmp2-dt.c @@ -22,7 +22,6 @@ #include "common.h" extern void __init mmp_dt_irq_init(void); -extern void __init mmp_dt_init_timer(void); static const struct of_dev_auxdata mmp2_auxdata_lookup[] __initconst = { OF_DEV_AUXDATA("marvell,mmp-uart", 0xd4030000, "pxa2xx-uart.0", NULL), @@ -50,7 +49,7 @@ static const char *mmp2_dt_board_compat[] __initdata = { DT_MACHINE_START(MMP2_DT, "Marvell MMP2 (Device Tree Support)") .map_io = mmp_map_io, .init_irq = mmp_dt_irq_init, - .init_time = mmp_dt_init_timer, + .init_time = clocksource_of_init, .init_machine = mmp2_dt_init, .dt_compat = mmp2_dt_board_compat, MACHINE_END diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c index 67e7d5c..8f5d612 100644 --- a/arch/arm/mach-mmp/time.c +++ b/arch/arm/mach-mmp/time.c @@ -207,22 +207,10 @@ void __init timer_init(int irq) } #ifdef CONFIG_OF -static struct of_device_id mmp_timer_dt_ids[] = { - { .compatible = "marvell,mmp-timer", }, - {} -}; - -void __init mmp_dt_init_timer(void) +static void __init mmp_of_init_timer(struct device_node *np) { - struct device_node *np; int irq, ret; - np = of_find_matching_node(NULL, mmp_timer_dt_ids); - if (!np) { - ret = -ENODEV; - goto out; - } - irq = irq_of_parse_and_map(np, 0); if (!irq) { ret = -EINVAL; @@ -238,4 +226,5 @@ void __init mmp_dt_init_timer(void) out: pr_err("Failed to get timer from device tree with error:%d\n", ret); } +CLOCKSOURCE_OF_DECLARE(mmp_timer, "marvell,mmp-timer", mmp_of_init_timer); #endif