From patchwork Mon May 9 07:14:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Behme X-Patchwork-Id: 9041651 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-renesas-soc@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 1A37B9F1C3 for ; Mon, 9 May 2016 07:15:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7C66520142 for ; Mon, 9 May 2016 07:15:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC7322012B for ; Mon, 9 May 2016 07:15:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751410AbcEIHPq (ORCPT ); Mon, 9 May 2016 03:15:46 -0400 Received: from smtp6-v.fe.bosch.de ([139.15.237.11]:57395 "EHLO smtp6-v.fe.bosch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750864AbcEIHPp (ORCPT ); Mon, 9 May 2016 03:15:45 -0400 Received: from vsmta12.fe.internet.bosch.com (unknown [10.4.98.52]) by imta24.fe.bosch.de (Postfix) with ESMTP id E4EE4D80079 for ; Mon, 9 May 2016 09:15:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=de.bosch.com; s=2015-01-21; t=1462778143; bh=icFWhIfoJDNnmwaL+dfFAXk///0PFS4A/c4xu/CT9nk=; l=10; h=From:From:Reply-To:Sender; b=qdiZ6HZbq7xiTTifrjtTy/hQLuGwyFGauhADd8jLhFePmCrivKJyDS8RP4N7xjjxn SP1fTzRZu3alpp6bReRS2RzL4tTQDjoK9jzX3zf3/H+AbduKYSGRDSjjHlckscAnHq vFTWve6PRiiXqNAbbx2jdTfwoCahAzHJYhGFRc0Y= Received: from SI-HUB1000.de.bosch.com (vsgw24.fe.internet.bosch.com [10.4.98.24]) by vsmta12.fe.internet.bosch.com (Postfix) with ESMTP id 9D4911B80398 for ; Mon, 9 May 2016 09:15:43 +0200 (CEST) Received: from hi-z08if.hi.de.bosch.com (10.34.209.31) by SI-HUB1000.de.bosch.com (10.4.103.106) with Microsoft SMTP Server id 14.3.195.1; Mon, 9 May 2016 09:15:40 +0200 Received: from hi-z08if.hi.de.bosch.com (localhost [127.0.0.1]) by hi-z08if.hi.de.bosch.com (Postfix) with ESMTP id BC35E625E98; Mon, 9 May 2016 09:14:03 +0200 (CEST) From: Dirk Behme To: Geert Uytterhoeven , Simon Horman , CC: Dirk Behme Subject: [PATCH 10/10] boot-mode-reg: Convert to device tree Date: Mon, 9 May 2016 09:14:01 +0200 Message-ID: <1462778041-19595-11-git-send-email-dirk.behme@de.bosch.com> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1462778041-19595-1-git-send-email-dirk.behme@de.bosch.com> References: <1462778041-19595-1-git-send-email-dirk.behme@de.bosch.com> MIME-Version: 1.0 X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-8.0.0.1202-22308.006 X-TMASE-MatchedRID: P5PncPndUjyeHTkwQi/s18nUT+eskUQPuP9+fQUL2ahAOR/x5IFWlWb6 PphVtfZggq4Vy91HEnZZqbwYJxSeDUfr6WG4Th9ayeVujmXuYYVyfMhzIcdGmpsoi2XrUn/Jn6K dMrRsL14qtq5d3cxkNWboZ5rNM7MdLx4149EjQU1dizQhpTcErkHvFCdyRdRI6E84rsAfqoXAvp LE+mvX8g== Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 From: Dirk Behme Instead of using a hard coded address in the driver for the boot mode register, optain it from the device tree. Signed-off-by: Dirk Behme --- drivers/misc/boot-mode-reg/rcar.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/misc/boot-mode-reg/rcar.c b/drivers/misc/boot-mode-reg/rcar.c index e994980..2cfbf9c 100644 --- a/drivers/misc/boot-mode-reg/rcar.c +++ b/drivers/misc/boot-mode-reg/rcar.c @@ -16,24 +16,32 @@ #include #include #include +#include #include -#define MODEMR 0xe6160060 - static int __init rcar_read_mode_pins(void) { void __iomem *modemr; + struct device_node *np; int err = -ENOMEM; static u32 mode; - modemr = ioremap_nocache(MODEMR, 4); + np = of_find_compatible_node(NULL, NULL, "renesas,modemr"); + if (!np) { + pr_err("can't find renesas,modemr device node"); + goto err; + } + + modemr = of_iomap(np, 0); if (!modemr) { pr_err("failed to map boot mode register"); + of_node_put(np); goto err; } mode = ioread32(modemr); iounmap(modemr); + of_node_put(np); err = boot_mode_reg_set(mode); err: