From patchwork Mon Mar 25 15:40:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 2332051 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 2D524DF24C for ; Mon, 25 Mar 2013 15:45:30 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UK9WB-0007Xi-U8; Mon, 25 Mar 2013 15:41:04 +0000 Received: from moutng.kundenserver.de ([212.227.126.187]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UK9W7-0007WF-Jz for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2013 15:41:00 +0000 Received: from klappe2.localnet (HSI-KBW-46-223-90-92.hsi.kabel-badenwuerttemberg.de [46.223.90.92]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MaDyS-1U4h4A28kK-00Jtq5; Mon, 25 Mar 2013 16:40:54 +0100 From: Arnd Bergmann To: Lee Jones Subject: Re: [PATCH 2/3] mfd: db8500-prcmu: Fetch the PRCMU TCDM base address from Device Tree Date: Mon, 25 Mar 2013 15:40:50 +0000 User-Agent: KMail/1.12.2 (Linux/3.8.0-13-generic; KDE/4.3.2; x86_64; ; ) References: <1364223758-17621-1-git-send-email-lee.jones@linaro.org> <1364223758-17621-2-git-send-email-lee.jones@linaro.org> In-Reply-To: <1364223758-17621-2-git-send-email-lee.jones@linaro.org> MIME-Version: 1.0 Message-Id: <201303251540.51104.arnd@arndb.de> X-Provags-ID: V02:K0:66l1pnHHoPBAHMx9RAiopiFvAlFdLm0uBQoeabw0ZWX L6MRmqhrm5hTU8E8z/tiheCQNmK2bEg8lUOj9hH9sKsqAkRnri Wo1DlxiMTt1o5IJXi5/KQwFasveKQ07X45Ao8FmuDTO6236wXT Ggoc6S9eEgZost4UNr+1D1oawePvlbI6Yw/GHAww2pPk8GUWJk ajL8xhalBl9KpoTpjCJQxEKGCdBa0r1S362WnOhQ9kIRwemW47 pdAyaCsiKetLwr25qNr4TcP0S8eeb/c7jUHWHlM1ZOlGVdxUVZ 5xo9a2WE5knZW1QeNU2/LtRadFcYinTrTEoSIeNVsoH2WY+dzf TztUg+VWnjKNkp+g0LDU= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130325_114059_904086_C276B627 X-CRM114-Status: GOOD ( 11.19 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.187 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linus.walleij@stericsson.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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 On Monday 25 March 2013, Lee Jones wrote: > res = platform_get_resource_byname(pdev, IORESOURCE_MEM, > "prcmu-tcpm"); > if (!res) { > - dev_err(&pdev->dev, > - "Error: no prcmu tcpm memory region provided\n"); > - return; > - } > - tcpm_base = ioremap(res->start, resource_size(res)); > + if (np) { > + tcpm_np = of_find_node_by_name(np->parent, > + "prcmu-tcpm-per4"); > + if (!tcpm_np) { > + dev_err(&pdev->dev, > + "no prcmu tcpm mem region provided\n"); > + return; > + } > + tcpm_base = of_iomap(tcpm_np, 0); > + } > + } else > + tcpm_base = ioremap(res->start, resource_size(res)); > + Why don't you just add these extra registers to the prcmu node itself like and document those in the prcmu binding? That would keep the code simpler and the same for both cases. Arnd diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi index 9de9309..6ee6c31 100644 --- a/arch/arm/boot/dts/dbx5x0.dtsi +++ b/arch/arm/boot/dts/dbx5x0.dtsi @@ -191,8 +191,8 @@ prcmu: prcmu@80157000 { compatible = "stericsson,db8500-prcmu"; - reg = <0x80157000 0x1000>; - reg-names = "prcmu"; + reg = <0x80157000 0x1000>, <0x801b0000 0x1000>, <0x801b8000 0x1000>; + reg-names = "prcmu", "prcmu-tcpm", "prcmu-tcdm-per4"; interrupts = <0 47 0x4>; #address-cells = <1>; #size-cells = <1>;