From: Arnd Bergmann <arnd@arndb.de>
To: Lee Jones <lee.jones@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linus.walleij@stericsson.com
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 [thread overview]
Message-ID: <201303251540.51104.arnd@arndb.de> (raw)
In-Reply-To: <1364223758-17621-2-git-send-email-lee.jones@linaro.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
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>;
and document those in the prcmu binding?
That would keep the code simpler and the same for both cases.
Arnd
next prev parent reply other threads:[~2013-03-25 15:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-25 15:02 [PATCH 1/3] ARM: ux500: Add device nodes for TCDM and TCPM memory locations Lee Jones
2013-03-25 15:02 ` [PATCH 2/3] mfd: db8500-prcmu: Fetch the PRCMU TCDM base address from Device Tree Lee Jones
2013-03-25 15:32 ` Lee Jones
2013-03-25 15:40 ` Arnd Bergmann [this message]
2013-03-25 16:46 ` Lee Jones
2013-03-25 21:32 ` Linus Walleij
2013-03-26 8:17 ` Lee Jones
2013-03-26 9:11 ` Linus Walleij
2013-03-26 9:48 ` Lee Jones
2013-03-26 10:00 ` Arnd Bergmann
2013-03-26 10:19 ` Lee Jones
2013-03-25 15:02 ` [PATCH 3/3] mfd: db8500-prcmu: Fetch the PRCMU TCPM " Lee Jones
2013-03-25 15:31 ` Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201303251540.51104.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox