From patchwork Wed Oct 26 07:35:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9396161 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7944260234 for ; Wed, 26 Oct 2016 07:37:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4106B298D1 for ; Wed, 26 Oct 2016 07:37:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35010298D3; Wed, 26 Oct 2016 07:37:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BDA56298D1 for ; Wed, 26 Oct 2016 07:37:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bzIkz-0001mZ-IG; Wed, 26 Oct 2016 07:36:17 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bzIku-0001kF-K3 for linux-arm-kernel@lists.infradead.org; Wed, 26 Oct 2016 07:36:13 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C4FE7615B4; Wed, 26 Oct 2016 07:35:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1477467351; bh=P4wQhnTj09FjeRjDZ9Y/zV67DAUF9uOTbRy5+GaSalM=; h=From:To:Cc:Subject:Date:From; b=fnkolifpjWxcfA6WZzyow97B2/sOoUE+K5agmFdAXXv9HKC+sUi38KHlDFwpPU+GG sesd6gV8TI+V3ici918lkQ668e2b9/mh8ewo8nRlQS0u0TIA/GrqmMu3t8BbpAxnr1 hnpMIDHXlyqsqNbbS1+MoXPA2R3DTTU2Rg/RxTBE= Received: from sboyd-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 211E6614EB; Wed, 26 Oct 2016 07:35:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1477467351; bh=P4wQhnTj09FjeRjDZ9Y/zV67DAUF9uOTbRy5+GaSalM=; h=From:To:Cc:Subject:Date:From; b=fnkolifpjWxcfA6WZzyow97B2/sOoUE+K5agmFdAXXv9HKC+sUi38KHlDFwpPU+GG sesd6gV8TI+V3ici918lkQ668e2b9/mh8ewo8nRlQS0u0TIA/GrqmMu3t8BbpAxnr1 hnpMIDHXlyqsqNbbS1+MoXPA2R3DTTU2Rg/RxTBE= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 211E6614EB Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=sboyd@codeaurora.org From: Stephen Boyd To: Mark Rutland , Marc Zyngier Subject: [PATCH v2] clocksource/arm_arch_timer: Map frame with of_io_request_and_map() Date: Wed, 26 Oct 2016 00:35:50 -0700 Message-Id: <20161026073550.22918-1-sboyd@codeaurora.org> X-Mailer: git-send-email 2.10.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161026_003612_782815_445C349C X-CRM114-Status: GOOD ( 11.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Gleixner , Daniel Lezcano , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Let's use the of_io_request_and_map() API so that the frame region is protected and shows up in /proc/iomem. Signed-off-by: Stephen Boyd Acked-by: Marc Zyngier --- Changes from v1: * Check for IS_ERR instead drivers/clocksource/arm_arch_timer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 73c487da6d2a..723cc924d8d1 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -964,8 +964,9 @@ static int __init arch_timer_mem_init(struct device_node *np) } ret= -ENXIO; - base = arch_counter_base = of_iomap(best_frame, 0); - if (!base) { + base = arch_counter_base = of_io_request_and_map(best_frame, 0, + "arch_mem_timer"); + if (IS_ERR(base)) { pr_err("arch_timer: Can't map frame's registers\n"); goto out; }