From patchwork Fri Jan 4 03:55:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 1930881 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id CD7E13FF0F for ; Fri, 4 Jan 2013 03:59:37 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TqyNk-0003PZ-Sy; Fri, 04 Jan 2013 03:55:44 +0000 Received: from avon.wwwdotorg.org ([2001:470:1f0f:bd7::2]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TqyNf-0003PD-Tz; Fri, 04 Jan 2013 03:55:42 +0000 Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id EFBE56320; Thu, 3 Jan 2013 20:56:35 -0700 (MST) Received: from dart.wwwdotorg.org (c-24-9-124-73.hsd1.co.comcast.net [24.9.124.73]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id 13143E461A; Thu, 3 Jan 2013 20:55:36 -0700 (MST) From: Stephen Warren To: Stephen Warren Subject: [PATCH] ARM: bcm2835: make use of CLKSRC_OF Date: Thu, 3 Jan 2013 20:55:27 -0700 Message-Id: <1357271727-2065-1-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.7.10.4 X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.96.5 at avon.wwwdotorg.org X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130103_225540_215314_AA6E1CF4 X-CRM114-Status: GOOD ( 17.08 ) 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: John Stultz , Thomas Gleixner , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org 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 Using CLKSRC_OF enables deletion of the SoC-specific header bcm2835_timer.h, replacing the custom function bcm2835_timer_init() with the standardized automatic clocksource_of_init(). Signed-off-by: Stephen Warren --- This is based on my arm-timer-rework branch, for which I'll send a pull request to arm-soc tomorrow. arch/arm/Kconfig | 1 + arch/arm/mach-bcm2835/bcm2835.c | 4 ++-- drivers/clocksource/bcm2835_timer.c | 5 +++-- include/linux/bcm2835_timer.h | 22 ---------------------- 4 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 include/linux/bcm2835_timer.h diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 91f8d78..2d274df 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -345,6 +345,7 @@ config ARCH_BCM2835 select ARM_ERRATA_411920 select ARM_TIMER_SP804 select CLKDEV_LOOKUP + select CLKSRC_OF select COMMON_CLK select CPU_V6 select GENERIC_CLOCKEVENTS diff --git a/arch/arm/mach-bcm2835/bcm2835.c b/arch/arm/mach-bcm2835/bcm2835.c index 1a446a1..6f57859 100644 --- a/arch/arm/mach-bcm2835/bcm2835.c +++ b/arch/arm/mach-bcm2835/bcm2835.c @@ -17,8 +17,8 @@ #include #include #include -#include #include +#include #include #include @@ -132,7 +132,7 @@ DT_MACHINE_START(BCM2835, "BCM2835") .init_irq = bcm2835_init_irq, .handle_irq = bcm2835_handle_irq, .init_machine = bcm2835_init, - .init_time = bcm2835_timer_init, + .init_time = clocksource_of_init, .restart = bcm2835_restart, .dt_compat = bcm2835_compat MACHINE_END diff --git a/drivers/clocksource/bcm2835_timer.c b/drivers/clocksource/bcm2835_timer.c index 7f796d8f..50c68fe 100644 --- a/drivers/clocksource/bcm2835_timer.c +++ b/drivers/clocksource/bcm2835_timer.c @@ -16,7 +16,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include #include @@ -101,7 +100,7 @@ static struct of_device_id bcm2835_time_match[] __initconst = { {} }; -void __init bcm2835_timer_init(void) +static void __init bcm2835_timer_init(void) { struct device_node *node; void __iomem *base; @@ -155,3 +154,5 @@ void __init bcm2835_timer_init(void) pr_info("bcm2835: system timer (irq = %d)\n", irq); } +CLOCKSOURCE_OF_DECLARE(bcm2835, "brcm,bcm2835-system-timer", + bcm2835_timer_init); diff --git a/include/linux/bcm2835_timer.h b/include/linux/bcm2835_timer.h deleted file mode 100644 index ca17aa8..0000000 --- a/include/linux/bcm2835_timer.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012 Simon Arlott - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#ifndef __BCM2835_TIMER_H -#define __BCM2835_TIMER_H - -#include - -extern void bcm2835_timer_init(void); - -#endif