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: 83364 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp2005168qge; Tue, 22 Nov 2016 01:45:41 -0800 (PST) X-Received: by 10.99.154.9 with SMTP id o9mr42265395pge.123.1479807941708; Tue, 22 Nov 2016 01:45:41 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si27615285pgn.280.2016.11.22.01.45.41; Tue, 22 Nov 2016 01:45:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755659AbcKVJpD (ORCPT + 26 others); Tue, 22 Nov 2016 04:45:03 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:37612 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755601AbcKVJo7 (ORCPT ); Tue, 22 Nov 2016 04:44:59 -0500 Received: by mail-wm0-f45.google.com with SMTP id t79so15223932wmt.0 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=bQe+VtxJDPYdcZJ3Ji3mZaCsq87+OjyGeurylEQjNGFm4hsUFyKM3RMdwai7/d3taY wNBCY10ZP4iShmEMDmsmP3Zdy5Q2gEyxtxAzRXvqFuzaEkfzJ8QM3itOSq5+wQomodcV CIG0TuXXkVBVD1Re00YfWFEhgeEalU+BLaQMvj2EGs2w4K/MM7zrniaCO6X6ycc9qNfQ Q26clVqM/tgO4KiorpEcTipzARF0IoxcMSciYOQ00SRtt3F8sJXjnHo6oORtvmyl0r6r 0X5UwH4X+8GlUn5lnBtIY6GOltGdR1z3DeCcoNEnEFDodni8h9W0D02gk1FQ2tVW4OA4 /o5w== X-Gm-Message-State: AKaTC00XdfnyTd6WNzPR1lYCqksufwdCZIHvQpf+dycPPi9v++b3gIehhTFN6ebM7Jn7KqN1 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 Cc: linux-kernel@vger.kernel.org, Stephen Boyd , Marc Zyngier , Mark Rutland , linux-arm-kernel@lists.infradead.org (moderated list:ARM ARCHITECTED TIMER DRIVER) 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.4 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; }