Re: powerpc_flash_init(), wtf!?

Mark A. Greer
2007-05-23T21:57:35Z

Sorry, I've lost the thread in my inbox so I can't reply to it directly.

Is something like this what everyone agreed upon?

Mark
--

diff --git a/arch/powerpc/platforms/embedded6xx/prpmc2800.c b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
index d9db135..44c3144 100644
--- a/arch/powerpc/platforms/embedded6xx/prpmc2800.c
+++ b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
@@ -20,6 +20,7 @@
#include <asm/system.h>
#include <asm/time.h>
#include <asm/kexec.h>
+#include <asm/of_platform.h>

#include <mm/mmu_decl.h>

@@ -134,6 +135,18 @@ void prpmc2800_show_cpuinfo(struct seq_file *m)
}

/*
+ * Register a platform device for MTD.
+ */
+static int __init prpmc2800_register_mtd(void)
+{
+ struct device_node *np;
+
+ np = of_find_compatible_node(NULL, "rom", "direct-mapped");
+ of_platform_device_create(np, np->name, NULL);
+}
+arch_initcall(prpmc2800_register_mtd);
+
+/*
* Called very early, device-tree isn't unflattened
*/
static int __init prpmc2800_probe(void)