Re: [PATCH 2/2] MPC8641 HPCN: publish all soc and flash devices

2008-01-22 Thread Kumar Gala

On Jan 22, 2008, at 10:47 AM, Wade Farnsworth wrote:

 Publish all soc and flash devices from the device tree, similar to  
 what
 is done for other boards.

 Signed-off-by: Wade Farnsworth [EMAIL PROTECTED]

 ---
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   16 
 1 file changed, 16 insertions(+)

 diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/ 
 powerpc/platforms/86xx/mpc86xx_hpcn.c
 index 14f4e52..f266264 100644
 --- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
 +++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
 @@ -18,6 +18,7 @@
 #include linux/kdev_t.h
 #include linux/delay.h
 #include linux/seq_file.h
 +#include linux/of_platform.h

 #include asm/system.h
 #include asm/time.h
 @@ -212,6 +213,21 @@ mpc86xx_time_init(void)
   return 0;
 }

 +static struct of_device_id mpc86xx_ids[] = {
 + { .type = soc, },
 + { .compatible = soc, },
 + { .compatible = cfi-flash, },
 + {},
 +};
 +
 +static int __init mpc86xx_publish_devices(void)
 +{
 + of_platform_bus_probe(NULL, mpc86xx_ids, NULL);
 +
 + return 0;
 +}
 +device_initcall(mpc86xx_publish_devices);
 +

this should look more like:

+static struct of_device_id __initdata of_bus_ids[] = {
+   { .compatible = simple-bus },
+   {},
+};
+
+static int __init declare_of_platform_devices(void)
+{
+   of_platform_bus_probe(NULL, of_bus_ids, NULL);
+   return 0;
+}
+machine_device_initcall(mpc86xx_hpcn, mpc86xx_publish_devices);
+



 define_machine(mpc86xx_hpcn) {
   .name   = MPC86xx HPCN,
   .probe  = mpc86xx_hpcn_probe,


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH 2/2] MPC8641 HPCN: publish all soc and flash devices

2008-01-22 Thread Wade Farnsworth
Publish all soc and flash devices from the device tree, similar to what
is done for other boards.

Signed-off-by: Wade Farnsworth [EMAIL PROTECTED]

---
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   16 
 1 file changed, 16 insertions(+)

diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c 
b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 14f4e52..f266264 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -18,6 +18,7 @@
 #include linux/kdev_t.h
 #include linux/delay.h
 #include linux/seq_file.h
+#include linux/of_platform.h
 
 #include asm/system.h
 #include asm/time.h
@@ -212,6 +213,21 @@ mpc86xx_time_init(void)
return 0;
 }
 
+static struct of_device_id mpc86xx_ids[] = {
+   { .type = soc, },
+   { .compatible = soc, },
+   { .compatible = cfi-flash, },
+   {},
+};
+
+static int __init mpc86xx_publish_devices(void)
+{
+   of_platform_bus_probe(NULL, mpc86xx_ids, NULL);
+
+   return 0;
+}
+device_initcall(mpc86xx_publish_devices);
+
 define_machine(mpc86xx_hpcn) {
.name   = MPC86xx HPCN,
.probe  = mpc86xx_hpcn_probe,


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH 2/2] MPC8641 HPCN: publish all soc and flash devices

2008-01-22 Thread Stephen Rothwell
Hi Wade,

On Tue, 22 Jan 2008 09:47:12 -0700 Wade Farnsworth [EMAIL PROTECTED] wrote:

 +static struct of_device_id mpc86xx_ids[] = {

__initdata, please.

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/


pgpPE23LG4t6d.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev