From patchwork Tue Nov 22 09:44:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 9440707 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 05D6560235 for ; Tue, 22 Nov 2016 09:49:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C4D323D5E for ; Tue, 22 Nov 2016 09:49:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2EE7252D5; Tue, 22 Nov 2016 09:49:43 +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 8AC9D23D5E for ; Tue, 22 Nov 2016 09:49:43 +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 1c97gW-00022V-Mo; Tue, 22 Nov 2016 09:48:16 +0000 Received: from mail-wj0-x236.google.com ([2a00:1450:400c:c01::236]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c97dg-0006yG-AY for linux-arm-kernel@lists.infradead.org; Tue, 22 Nov 2016 09:45:31 +0000 Received: by mail-wj0-x236.google.com with SMTP id mp19so39724775wjc.1 for ; Tue, 22 Nov 2016 01:44:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TtWaqsYJTjznFoncKUvIsKVLTyoNYsscvdy1yuCHYaI=; b=h4o4kA5FPD8d9r/kmjshVUsHofdVpHB3vPrDW+g5nAo/drGv9uoqajbBu/cW5Lvt73 NgZNVGOZpBcJ0bZM5SZll5xMLVeFpcjl4x+C6Qgkkgv78c+J+WhfbVNsAFtPiMYkSYNZ wMzNypSuo79ClF2TsIHYrnUZMZW5MBVwgHBag= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TtWaqsYJTjznFoncKUvIsKVLTyoNYsscvdy1yuCHYaI=; b=VV91qVpJE2rYfg7w2MNczvtzczShPKELLfwPLBTNYmwVM14SlGYUFCYl5qk6D31oPv epvH11lSz3m655vTzykywIPBvHYt2jGXi+gHRP47fMnWIhz3AX5rGeCOPv/7O5mJYLK+ f99zIFA5AGbvVvSUKUjYOxFwo/4wYoBR4Co3L03Nmjg8Xnj+qCM4mpykCRi4eC+f19fu GN1NIlc1crK/aPWdXgw53OjVQ8nb/K/4bSpHi8GQyKk3RoWDCSLlZcfk4comXti4zXg/ Mhxango1ssBJM4wdXAm2/e5cIbYwCvJGdzNTuULCfyTYpNkCrVsqZ0ye+8f4vylNLXQG EMiQ== X-Gm-Message-State: AKaTC01576B8EWf1swWExDwU/b3hUFCWGNOp5x6/z8D6JpfTM97yN6HCb94IIifpj2YfsnIa X-Received: by 10.194.186.177 with SMTP id fl17mr12582787wjc.143.1479807898161; Tue, 22 Nov 2016 01:44:58 -0800 (PST) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:d4cd:7489:29a3:d5ed]) by smtp.gmail.com with ESMTPSA id ab10sm29789450wjc.45.2016.11.22.01.44.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Nov 2016 01:44:57 -0800 (PST) From: Daniel Lezcano To: tglx@linutronix.de Subject: [PATCH 3/4] clocksource/drivers/arm_arch_timer: Map frame with of_io_request_and_map() Date: Tue, 22 Nov 2016 10:44:23 +0100 Message-Id: <1479807866-6957-3-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479807866-6957-1-git-send-email-daniel.lezcano@linaro.org> References: <20161122094300.GA2017@mai> <1479807866-6957-1-git-send-email-daniel.lezcano@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161122_014520_890303_998AB522 X-CRM114-Status: GOOD ( 11.50 ) 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: Marc Zyngier , Mark Rutland , Stephen Boyd , linux-kernel@vger.kernel.org, "moderated list:ARM ARCHITECTED TIMER DRIVER" 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 From: Stephen Boyd 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 Signed-off-by: Daniel Lezcano Acked-by: Marc Zyngier --- 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 a2503db..02fef68 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -971,8 +971,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; }