summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMarian Balakowicz <m8@semihalf.com>2007-10-19 04:44:14 +1000
committerGrant Likely <grant.likely@secretlab.ca>2007-10-21 12:42:47 -0600
commitc5c01c9700e59a5b20d7bdd15808d33ab9d9e877 (patch)
tree4c49b4e38dea900acffbc65dc91012b4b819ea02 /arch
parentc052a22e808fc1f9b78b9a2fe7065f2026815128 (diff)
[POWERPC] Add mpc52xx_find_and_map_path(), refactor utility functions
Add helper routine mpc52xx_find_and_map_path(). Extract common code to mpc52xx_map_node() and refactor mpc52xx_find_and_map(). Signed-off-by: Jan Wrobel <wrr@semihalf.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_common.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c
index 3bc201e07e6..74b4b418384 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_common.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
@@ -19,14 +19,12 @@
#include <asm/mpc52xx.h>
-void __iomem *
-mpc52xx_find_and_map(const char *compatible)
+static void __iomem *
+mpc52xx_map_node(struct device_node *ofn)
{
- struct device_node *ofn;
const u32 *regaddr_p;
u64 regaddr64, size64;
- ofn = of_find_compatible_node(NULL, NULL, compatible);
if (!ofn)
return NULL;
@@ -42,8 +40,23 @@ mpc52xx_find_and_map(const char *compatible)
return ioremap((u32)regaddr64, (u32)size64);
}
+
+void __iomem *
+mpc52xx_find_and_map(const char *compatible)
+{
+ return mpc52xx_map_node(
+ of_find_compatible_node(NULL, NULL, compatible));
+}
+
EXPORT_SYMBOL(mpc52xx_find_and_map);
+void __iomem *
+mpc52xx_find_and_map_path(const char *path)
+{
+ return mpc52xx_map_node(of_find_node_by_path(path));
+}
+
+EXPORT_SYMBOL(mpc52xx_find_and_map_path);
/**
* mpc52xx_find_ipb_freq - Find the IPB bus frequency for a device