From: Scott Wood <scottwood@freescale.com>
To: galak@kernel.crashing.org
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH] fsl_soc: Fix get_immrbase() to use ranges, rather than reg.
Date: Fri, 11 Jan 2008 14:09:38 -0600 [thread overview]
Message-ID: <20080111200938.GA766@loki.buserror.net> (raw)
The reg property in fsl soc nodes should be removed.
Signed-off-by: Scott Wood <scottwood@freescale.com>
---
arch/powerpc/sysdev/fsl_soc.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 3ace747..7502e03 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -54,10 +54,18 @@ phys_addr_t get_immrbase(void)
soc = of_find_node_by_type(NULL, "soc");
if (soc) {
int size;
- const void *prop = of_get_property(soc, "reg", &size);
+ u32 naddr;
+ const u32 *prop = of_get_property(soc, "#address-cells", &size);
+
+ if (prop && size == 4)
+ naddr = *prop;
+ else
+ naddr = 2;
+
+ prop = of_get_property(soc, "ranges", &size);
+ if (prop)
+ immrbase = of_translate_address(soc, prop + naddr);
- if (prop)
- immrbase = of_translate_address(soc, prop);
of_node_put(soc);
}
--
1.5.3
next reply other threads:[~2008-01-11 21:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-11 20:09 Scott Wood [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-01-14 16:29 [PATCH] fsl_soc: Fix get_immrbase() to use ranges, rather than reg Scott Wood
2008-01-15 2:37 ` Kumar Gala
2008-01-15 16:40 ` Scott Wood
2008-01-15 17:07 ` Kumar Gala
2008-01-15 18:07 ` Scott Wood
2008-01-18 21:53 ` Kumar Gala
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=20080111200938.GA766@loki.buserror.net \
--to=scottwood@freescale.com \
--cc=galak@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).