From patchwork Thu Apr 30 14:44:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shenwei Wang X-Patchwork-Id: 6304881 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 578329F373 for ; Thu, 30 Apr 2015 14:56:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 85FE82011D for ; Thu, 30 Apr 2015 14:56:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B3B35200FE for ; Thu, 30 Apr 2015 14:56:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ynppp-00028m-Kt; Thu, 30 Apr 2015 14:53:05 +0000 Received: from mail-by2on0138.outbound.protection.outlook.com ([207.46.100.138] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YnpkH-0005WJ-Lb for linux-arm-kernel@lists.infradead.org; Thu, 30 Apr 2015 14:47:22 +0000 Received: from DM2PR03CA0026.namprd03.prod.outlook.com (10.141.96.25) by BY1PR0301MB1192.namprd03.prod.outlook.com (25.160.195.150) with Microsoft SMTP Server (TLS) id 15.1.154.19; Thu, 30 Apr 2015 14:46:59 +0000 Received: from BN1BFFO11FD001.protection.gbl (2a01:111:f400:7c10::1:152) by DM2PR03CA0026.outlook.office365.com (2a01:111:e400:2428::25) with Microsoft SMTP Server (TLS) id 15.1.154.19 via Frontend Transport; Thu, 30 Apr 2015 14:46:59 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; lists.infradead.org; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD001.mail.protection.outlook.com (10.58.144.64) with Microsoft SMTP Server (TLS) id 15.1.160.8 via Frontend Transport; Thu, 30 Apr 2015 14:46:58 +0000 Received: from [az84smr01.freescale.net (B38339-11.am.freescale.net [10.81.92.140]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t3UEieid026417; Thu, 30 Apr 2015 07:46:56 -0700 From: Shenwei Wang To: Subject: [PATCH 12/18] ARM: imx: Remove one global variable in mxc_clocksource_init Date: Thu, 30 Apr 2015 09:44:27 -0500 Message-ID: <1430405073-13106-13-git-send-email-shenwei.wang@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430405073-13106-1-git-send-email-shenwei.wang@freescale.com> References: <1430405073-13106-1-git-send-email-shenwei.wang@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(339900001)(199003)(189002)(92566002)(77096005)(47776003)(106466001)(50226001)(85426001)(105606002)(62966003)(77156002)(87936001)(2950100001)(229853001)(36756003)(2351001)(6806004)(46102003)(86362001)(19580405001)(19580395003)(104016003)(76176999)(48376002)(50986999)(110136002)(33646002)(5001960100002)(50466002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY1PR0301MB1192; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0301MB1192; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BY1PR0301MB1192; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0301MB1192; X-Forefront-PRVS: 056297E276 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2015 14:46:58.6247 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0301MB1192 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150430_074721_743735_A487EFA2 X-CRM114-Status: UNSURE ( 7.43 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) Cc: linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Removed the use of global variable "timer_base" in the function of mxc_clocksource_init, and get the register address from the input parameter. Signed-off-by: Shenwei Wang --- arch/arm/mach-imx/time.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c index b20ee80..4a6c625 100644 --- a/arch/arm/mach-imx/time.c +++ b/arch/arm/mach-imx/time.c @@ -202,16 +202,17 @@ static int __init mxc_clocksource_init(struct clk *timer_clk, void __iomem *addr) { unsigned int c = clk_get_rate(timer_clk); - void __iomem *reg = timer_base + (timer_is_v2() ? V2_TCN : MX1_2_TCN); + + BUG_ON(!addr); imx_delay_timer.read_current_timer = &imx_read_current_timer; imx_delay_timer.freq = c; register_current_timer_delay(&imx_delay_timer); - sched_clock_reg = reg; + sched_clock_reg = addr; sched_clock_register(mxc_read_sched_clock, 32, c); - return clocksource_mmio_init(reg, "mxc_timer1", c, 200, 32, + return clocksource_mmio_init(addr, "mxc_timer1", c, 200, 32, clocksource_mmio_readl_up); }