linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Make platform code use machine_*_initcall() macros
@ 2008-01-02 19:14 Grant Likely
  2008-01-02 19:14 ` [PATCH 1/5] [POWERPC] powermac: Use machine_*_initcall() hooks in platform code Grant Likely
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Grant Likely @ 2008-01-02 19:14 UTC (permalink / raw)
  To: linuxppc-dev, benh, vitb, galak, olof

This series makes the platform code use the new machine-specific initcall
hooks.  This has the advantage of not needing to explicitly test
machine_is() at the top of every initcall function.

This time I split the changes out into separate patches so each platform
maintainer can pick up the ones they are responsible for.  Please note;
these are untested as I don't have any of the hardware.

Cheers,
g.

--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/5] [POWERPC] powermac: Use machine_*_initcall() hooks in platform code
  2008-01-02 19:14 [PATCH 0/5] Make platform code use machine_*_initcall() macros Grant Likely
@ 2008-01-02 19:14 ` Grant Likely
  2008-01-02 20:20   ` Benjamin Herrenschmidt
  2008-01-02 19:14 ` [PATCH 2/5] [POWERPC] cell: " Grant Likely
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Grant Likely @ 2008-01-02 19:14 UTC (permalink / raw)
  To: linuxppc-dev, benh, vitb, galak, olof

From: Grant Likely <grant.likely@secretlab.ca>

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

 arch/powerpc/platforms/powermac/low_i2c.c    |    7 ++-----
 arch/powerpc/platforms/powermac/pfunc_base.c |    3 +--
 arch/powerpc/platforms/powermac/pic.c        |    3 +--
 arch/powerpc/platforms/powermac/setup.c      |   12 ++----------
 4 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index da2007e..9c9299c 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -1462,9 +1462,6 @@ int __init pmac_i2c_init(void)
 		return 0;
 	i2c_inited = 1;
 
-	if (!machine_is(powermac))
-		return 0;
-
 	/* Probe keywest-i2c busses */
 	kw_i2c_probe();
 
@@ -1483,7 +1480,7 @@ int __init pmac_i2c_init(void)
 
 	return 0;
 }
-arch_initcall(pmac_i2c_init);
+machine_arch_initcall(powermac, pmac_i2c_init);
 
 /* Since pmac_i2c_init can be called too early for the platform device
  * registration, we need to do it at a later time. In our case, subsys
@@ -1515,4 +1512,4 @@ static int __init pmac_i2c_create_platform_devices(void)
 
 	return 0;
 }
-subsys_initcall(pmac_i2c_create_platform_devices);
+machine_subsys_initcall(powermac, pmac_i2c_create_platform_devices);
diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c
index 45d54b9..db20de5 100644
--- a/arch/powerpc/platforms/powermac/pfunc_base.c
+++ b/arch/powerpc/platforms/powermac/pfunc_base.c
@@ -363,8 +363,7 @@ int __init pmac_pfunc_base_install(void)
 
 	return 0;
 }
-
-arch_initcall(pmac_pfunc_base_install);
+machine_arch_initcall(powermac, pmac_pfunc_base_install);
 
 #ifdef CONFIG_PM
 
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 999f5e1..cd72164 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -690,6 +690,5 @@ static int __init init_pmacpic_sysfs(void)
 	sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic);
 	return 0;
 }
-
-subsys_initcall(init_pmacpic_sysfs);
+machine_subsys_initcall(powermac, init_pmacpic_sysfs);
 
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index adad4e9..36ff1b6 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -397,17 +397,13 @@ static int initializing = 1;
 
 static int pmac_late_init(void)
 {
-	if (!machine_is(powermac))
-		return -ENODEV;
-
 	initializing = 0;
 	/* this is udbg (which is __init) and we can later use it during
 	 * cpu hotplug (in smp_core99_kick_cpu) */
 	ppc_md.progress = NULL;
 	return 0;
 }
-
-late_initcall(pmac_late_init);
+machine_late_initcall(powermac, pmac_late_init);
 
 /*
  * This is __init_refok because we check for "initializing" before
@@ -534,9 +530,6 @@ static int __init pmac_declare_of_platform_devices(void)
 	if (machine_is(chrp))
 		return -1;
 
-	if (!machine_is(powermac))
-		return 0;
-
 	np = of_find_node_by_name(NULL, "valkyrie");
 	if (np)
 		of_platform_device_create(np, "valkyrie", NULL);
@@ -551,8 +544,7 @@ static int __init pmac_declare_of_platform_devices(void)
 
 	return 0;
 }
-
-device_initcall(pmac_declare_of_platform_devices);
+machine_device_initcall(powermac, pmac_declare_of_platform_devices);
 
 /*
  * Called very early, MMU is off, device-tree isn't unflattened

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/5] [POWERPC] cell: Use machine_*_initcall() hooks in platform code
  2008-01-02 19:14 [PATCH 0/5] Make platform code use machine_*_initcall() macros Grant Likely
  2008-01-02 19:14 ` [PATCH 1/5] [POWERPC] powermac: Use machine_*_initcall() hooks in platform code Grant Likely
@ 2008-01-02 19:14 ` Grant Likely
  2008-01-02 19:25   ` Arnd Bergmann
  2008-01-02 19:32 ` [PATCH 3/5] [POWERPC] pasemi: " Grant Likely
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Grant Likely @ 2008-01-02 19:14 UTC (permalink / raw)
  To: linuxppc-dev, benh, vitb, galak, olof

From: Grant Likely <grant.likely@secretlab.ca>

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

 arch/powerpc/platforms/cell/io-workarounds.c |    5 +----
 arch/powerpc/platforms/cell/iommu.c          |    7 ++-----
 arch/powerpc/platforms/cell/pmu.c            |    5 +----
 arch/powerpc/platforms/cell/setup.c          |    5 +----
 arch/powerpc/platforms/celleb/iommu.c        |    5 +----
 arch/powerpc/platforms/celleb/setup.c        |    7 ++-----
 6 files changed, 8 insertions(+), 26 deletions(-)

diff --git a/arch/powerpc/platforms/cell/io-workarounds.c b/arch/powerpc/platforms/cell/io-workarounds.c
index b86076e..979d4b6 100644
--- a/arch/powerpc/platforms/cell/io-workarounds.c
+++ b/arch/powerpc/platforms/cell/io-workarounds.c
@@ -309,9 +309,6 @@ static int __init spider_pci_workaround_init(void)
 {
 	struct pci_controller *phb;
 
-	if (!machine_is(cell))
-		return 0;
-
 	/* Find spider bridges. We assume they have been all probed
 	 * in setup_arch(). If that was to change, we would need to
 	 * update this code to cope with dynamically added busses
@@ -343,4 +340,4 @@ static int __init spider_pci_workaround_init(void)
 
 	return 0;
 }
-arch_initcall(spider_pci_workaround_init);
+machine_arch_initcall(cell, spider_pci_workaround_init);
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 1221c6d..bceb5e1 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -700,10 +700,6 @@ static int __init cell_iommu_init(void)
 {
 	struct device_node *np;
 
-	if (!machine_is(cell) &&
-	    !machine_is(celleb_native))
-		return -ENODEV;
-
 	/* If IOMMU is disabled or we have little enough RAM to not need
 	 * to enable it, we setup a direct mapping.
 	 *
@@ -746,5 +742,6 @@ static int __init cell_iommu_init(void)
 
 	return 0;
 }
-arch_initcall(cell_iommu_init);
+machine_arch_initcall(cell, cell_iommu_init);
+machine_arch_initcall(celleb_native, cell_iommu_init);
 
diff --git a/arch/powerpc/platforms/cell/pmu.c b/arch/powerpc/platforms/cell/pmu.c
index 99d688e..69ed0d7 100644
--- a/arch/powerpc/platforms/cell/pmu.c
+++ b/arch/powerpc/platforms/cell/pmu.c
@@ -381,9 +381,6 @@ static int __init cbe_init_pm_irq(void)
 	unsigned int irq;
 	int rc, node;
 
-	if (!machine_is(cell))
-		return 0;
-
 	for_each_node(node) {
 		irq = irq_create_mapping(NULL, IIC_IRQ_IOEX_PMI |
 					       (node << IIC_IRQ_NODE_SHIFT));
@@ -404,7 +401,7 @@ static int __init cbe_init_pm_irq(void)
 
 	return 0;
 }
-arch_initcall(cbe_init_pm_irq);
+machine_arch_initcall(cell, cbe_init_pm_irq);
 
 void cbe_sync_irq(int node)
 {
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index 4f6347c..e6534b5 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -85,9 +85,6 @@ static int __init cell_publish_devices(void)
 {
 	int node;
 
-	if (!machine_is(cell))
-		return 0;
-
 	/* Publish OF platform devices for southbridge IOs */
 	of_platform_bus_probe(NULL, NULL, NULL);
 
@@ -101,7 +98,7 @@ static int __init cell_publish_devices(void)
 	}
 	return 0;
 }
-device_initcall(cell_publish_devices);
+machine_device_initcall(cell, cell_publish_devices);
 
 static void cell_mpic_cascade(unsigned int irq, struct irq_desc *desc)
 {
diff --git a/arch/powerpc/platforms/celleb/iommu.c b/arch/powerpc/platforms/celleb/iommu.c
index fbe718d..41e1e6f 100644
--- a/arch/powerpc/platforms/celleb/iommu.c
+++ b/arch/powerpc/platforms/celleb/iommu.c
@@ -92,9 +92,6 @@ static struct notifier_block celleb_of_bus_notifier = {
 
 static int __init celleb_init_iommu(void)
 {
-	if (!machine_is(celleb_beat))
-		return -ENODEV;
-
 	celleb_init_direct_mapping();
 	set_pci_dma_ops(&dma_direct_ops);
 	bus_register_notifier(&of_platform_bus_type, &celleb_of_bus_notifier);
@@ -102,4 +99,4 @@ static int __init celleb_init_iommu(void)
 	return 0;
 }
 
-arch_initcall(celleb_init_iommu);
+machine_arch_initcall(celleb_beat, celleb_init_iommu);
diff --git a/arch/powerpc/platforms/celleb/setup.c b/arch/powerpc/platforms/celleb/setup.c
index 0f0c468..f27ae1e 100644
--- a/arch/powerpc/platforms/celleb/setup.c
+++ b/arch/powerpc/platforms/celleb/setup.c
@@ -111,10 +111,6 @@ static struct of_device_id celleb_bus_ids[] __initdata = {
 
 static int __init celleb_publish_devices(void)
 {
-	if (!machine_is(celleb_beat) &&
-	    !machine_is(celleb_native))
-		return -ENODEV;
-
 	/* Publish OF platform devices for southbridge IOs */
 	of_platform_bus_probe(NULL, celleb_bus_ids, NULL);
 
@@ -122,7 +118,8 @@ static int __init celleb_publish_devices(void)
 
 	return 0;
 }
-device_initcall(celleb_publish_devices);
+machine_device_initcall(celleb_beat, celleb_publish_devices);
+machine_device_initcall(celleb_native, celleb_publish_devices);
 
 
 /*

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/5] [POWERPC] cell: Use machine_*_initcall() hooks in platform code
  2008-01-02 19:14 ` [PATCH 2/5] [POWERPC] cell: " Grant Likely
@ 2008-01-02 19:25   ` Arnd Bergmann
  0 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2008-01-02 19:25 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: olof

On Wednesday 02 January 2008, Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
> 
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

Looks good, thanks!

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/5] [POWERPC] pasemi: Use machine_*_initcall() hooks in platform code
  2008-01-02 19:14 [PATCH 0/5] Make platform code use machine_*_initcall() macros Grant Likely
  2008-01-02 19:14 ` [PATCH 1/5] [POWERPC] powermac: Use machine_*_initcall() hooks in platform code Grant Likely
  2008-01-02 19:14 ` [PATCH 2/5] [POWERPC] cell: " Grant Likely
@ 2008-01-02 19:32 ` Grant Likely
  2008-01-02 20:30   ` Olof Johansson
  2008-01-02 19:32 ` [PATCH 4/5] [POWERPC] 8xx: " Grant Likely
  2008-01-02 19:33 ` [PATCH 5/5] [POWERPC] 8xxx and embedded6xx: " Grant Likely
  4 siblings, 1 reply; 11+ messages in thread
From: Grant Likely @ 2008-01-02 19:32 UTC (permalink / raw)
  To: linuxppc-dev, benh, vitb, galak, olof

From: Grant Likely <grant.likely@secretlab.ca>

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

 arch/powerpc/platforms/pasemi/idle.c  |    5 +----
 arch/powerpc/platforms/pasemi/setup.c |   10 ++--------
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/platforms/pasemi/idle.c b/arch/powerpc/platforms/pasemi/idle.c
index d8e1fcc..43911d8 100644
--- a/arch/powerpc/platforms/pasemi/idle.c
+++ b/arch/powerpc/platforms/pasemi/idle.c
@@ -74,9 +74,6 @@ static int pasemi_system_reset_exception(struct pt_regs *regs)
 
 static int __init pasemi_idle_init(void)
 {
-	if (!machine_is(pasemi))
-		return -ENODEV;
-
 #ifndef CONFIG_PPC_PASEMI_CPUFREQ
 	printk(KERN_WARNING "No cpufreq driver, powersavings modes disabled\n");
 	current_mode = 0;
@@ -88,7 +85,7 @@ static int __init pasemi_idle_init(void)
 
 	return 0;
 }
-late_initcall(pasemi_idle_init);
+machine_late_initcall(pasemi, pasemi_idle_init);
 
 static int __init idle_param(char *p)
 {
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index 1940e67..98c7f3b 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -135,9 +135,6 @@ static int __init pas_setup_mce_regs(void)
 	struct pci_dev *dev;
 	int reg;
 
-	if (!machine_is(pasemi))
-		return -ENODEV;
-
 	/* Remap various SoC status registers for use by the MCE handler */
 
 	reg = 0;
@@ -181,7 +178,7 @@ static int __init pas_setup_mce_regs(void)
 
 	return 0;
 }
-device_initcall(pas_setup_mce_regs);
+machine_device_initcall(pasemi, pas_setup_mce_regs);
 
 static __init void pas_init_IRQ(void)
 {
@@ -405,9 +402,6 @@ static struct of_device_id pasemi_bus_ids[] = {
 
 static int __init pasemi_publish_devices(void)
 {
-	if (!machine_is(pasemi))
-		return 0;
-
 	pasemi_pcmcia_init();
 
 	/* Publish OF platform devices for SDC and other non-PCI devices */
@@ -415,7 +409,7 @@ static int __init pasemi_publish_devices(void)
 
 	return 0;
 }
-device_initcall(pasemi_publish_devices);
+machine_device_initcall(pasemi, pasemi_publish_devices);
 
 
 /*

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/5] [POWERPC] 8xx: Use machine_*_initcall() hooks in platform code
  2008-01-02 19:14 [PATCH 0/5] Make platform code use machine_*_initcall() macros Grant Likely
                   ` (2 preceding siblings ...)
  2008-01-02 19:32 ` [PATCH 3/5] [POWERPC] pasemi: " Grant Likely
@ 2008-01-02 19:32 ` Grant Likely
  2008-01-03 17:37   ` Scott Wood
  2008-01-02 19:33 ` [PATCH 5/5] [POWERPC] 8xxx and embedded6xx: " Grant Likely
  4 siblings, 1 reply; 11+ messages in thread
From: Grant Likely @ 2008-01-02 19:32 UTC (permalink / raw)
  To: linuxppc-dev, benh, vitb, galak, olof

From: Grant Likely <grant.likely@secretlab.ca>

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

 arch/powerpc/platforms/8xx/ep88xc.c          |    5 ++---
 arch/powerpc/platforms/8xx/mpc885ads_setup.c |    5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c
index c518b6c..88afa35 100644
--- a/arch/powerpc/platforms/8xx/ep88xc.c
+++ b/arch/powerpc/platforms/8xx/ep88xc.c
@@ -155,12 +155,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
 static int __init declare_of_platform_devices(void)
 {
 	/* Publish the QE devices */
-	if (machine_is(ep88xc))
-		of_platform_bus_probe(NULL, of_bus_ids, NULL);
+	of_platform_bus_probe(NULL, of_bus_ids, NULL);
 
 	return 0;
 }
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(ep88xc, declare_of_platform_devices);
 
 define_machine(ep88xc) {
 	.name = "Embedded Planet EP88xC",
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 2cf1b6a..6ef8e9e 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -264,12 +264,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
 static int __init declare_of_platform_devices(void)
 {
 	/* Publish the QE devices */
-	if (machine_is(mpc885_ads))
-		of_platform_bus_probe(NULL, of_bus_ids, NULL);
+	of_platform_bus_probe(NULL, of_bus_ids, NULL);
 
 	return 0;
 }
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(mpc885_ads, declare_of_platform_devices);
 
 define_machine(mpc885_ads) {
 	.name			= "Freescale MPC885 ADS",

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/5] [POWERPC] 8xxx and embedded6xx: Use machine_*_initcall() hooks in platform code
  2008-01-02 19:14 [PATCH 0/5] Make platform code use machine_*_initcall() macros Grant Likely
                   ` (3 preceding siblings ...)
  2008-01-02 19:32 ` [PATCH 4/5] [POWERPC] 8xx: " Grant Likely
@ 2008-01-02 19:33 ` Grant Likely
  4 siblings, 0 replies; 11+ messages in thread
From: Grant Likely @ 2008-01-02 19:33 UTC (permalink / raw)
  To: linuxppc-dev, benh, vitb, galak, olof

From: Grant Likely <grant.likely@secretlab.ca>

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

 arch/powerpc/platforms/82xx/mpc8272_ads.c    |    5 +----
 arch/powerpc/platforms/82xx/pq2fads.c        |    5 +----
 arch/powerpc/platforms/83xx/mpc832x_mds.c    |    5 +----
 arch/powerpc/platforms/83xx/mpc832x_rdb.c    |   11 ++---------
 arch/powerpc/platforms/83xx/mpc834x_mds.c    |    5 +----
 arch/powerpc/platforms/83xx/mpc836x_mds.c    |    5 +----
 arch/powerpc/platforms/83xx/mpc837x_mds.c    |    5 +----
 arch/powerpc/platforms/85xx/mpc85xx_ads.c    |    5 +----
 arch/powerpc/platforms/85xx/mpc85xx_cds.c    |    6 +-----
 arch/powerpc/platforms/85xx/mpc85xx_mds.c    |    5 +----
 arch/powerpc/platforms/8xx/mpc86xads_setup.c |    5 ++---
 arch/powerpc/platforms/embedded6xx/ls_uart.c |    5 +----
 12 files changed, 14 insertions(+), 53 deletions(-)

diff --git a/arch/powerpc/platforms/82xx/mpc8272_ads.c b/arch/powerpc/platforms/82xx/mpc8272_ads.c
index fd83440..3fce6b3 100644
--- a/arch/powerpc/platforms/82xx/mpc8272_ads.c
+++ b/arch/powerpc/platforms/82xx/mpc8272_ads.c
@@ -165,14 +165,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
 
 static int __init declare_of_platform_devices(void)
 {
-	if (!machine_is(mpc8272_ads))
-		return 0;
-
 	/* Publish the QE devices */
 	of_platform_bus_probe(NULL, of_bus_ids, NULL);
 	return 0;
 }
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(mpc8272_ads, declare_of_platform_devices);
 
 /*
  * Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/82xx/pq2fads.c b/arch/powerpc/platforms/82xx/pq2fads.c
index 1be5005..68196e3 100644
--- a/arch/powerpc/platforms/82xx/pq2fads.c
+++ b/arch/powerpc/platforms/82xx/pq2fads.c
@@ -176,14 +176,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
 
 static int __init declare_of_platform_devices(void)
 {
-	if (!machine_is(pq2fads))
-		return 0;
-
 	/* Publish the QE devices */
 	of_platform_bus_probe(NULL, of_bus_ids, NULL);
 	return 0;
 }
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(pq2fads, declare_of_platform_devices);
 
 define_machine(pq2fads)
 {
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 1e570bb..dbdd4ad 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -110,15 +110,12 @@ static struct of_device_id mpc832x_ids[] = {
 
 static int __init mpc832x_declare_of_platform_devices(void)
 {
-	if (!machine_is(mpc832x_mds))
-		return 0;
-
 	/* Publish the QE devices */
 	of_platform_bus_probe(NULL, mpc832x_ids, NULL);
 
 	return 0;
 }
-device_initcall(mpc832x_declare_of_platform_devices);
+machine_device_initcall(mpc832x_mds, mpc832x_declare_of_platform_devices);
 
 static void __init mpc832x_sys_init_IRQ(void)
 {
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index ffb2e93..1b57028 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -63,9 +63,6 @@ static struct spi_board_info mpc832x_spi_boardinfo = {
 
 static int __init mpc832x_spi_init(void)
 {
-	if (!machine_is(mpc832x_rdb))
-		return 0;
-
 	par_io_config_pin(3,  0, 3, 0, 1, 0); /* SPI1 MOSI, I/O */
 	par_io_config_pin(3,  1, 3, 0, 1, 0); /* SPI1 MISO, I/O */
 	par_io_config_pin(3,  2, 3, 0, 1, 0); /* SPI1 CLK,  I/O */
@@ -79,8 +76,7 @@ static int __init mpc832x_spi_init(void)
 			    mpc83xx_spi_activate_cs,
 			    mpc83xx_spi_deactivate_cs);
 }
-
-device_initcall(mpc832x_spi_init);
+machine_device_initcall(mpc832x_rdb, mpc832x_spi_init);
 
 /* ************************************************************************
  *
@@ -123,15 +119,12 @@ static struct of_device_id mpc832x_ids[] = {
 
 static int __init mpc832x_declare_of_platform_devices(void)
 {
-	if (!machine_is(mpc832x_rdb))
-		return 0;
-
 	/* Publish the QE devices */
 	of_platform_bus_probe(NULL, mpc832x_ids, NULL);
 
 	return 0;
 }
-device_initcall(mpc832x_declare_of_platform_devices);
+machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices);
 
 void __init mpc832x_rdb_init_IRQ(void)
 {
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 459fb72..2b8a0a3 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -115,13 +115,10 @@ static struct of_device_id mpc834x_ids[] = {
 
 static int __init mpc834x_declare_of_platform_devices(void)
 {
-	if (!machine_is(mpc834x_mds))
-		return 0;
-
 	of_platform_bus_probe(NULL, mpc834x_ids, NULL);
 	return 0;
 }
-device_initcall(mpc834x_declare_of_platform_devices);
+machine_device_initcall(mpc834x_mds, mpc834x_declare_of_platform_devices);
 
 /*
  * Called very early, MMU is off, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 2ac9890..db491ec 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -141,15 +141,12 @@ static struct of_device_id mpc836x_ids[] = {
 
 static int __init mpc836x_declare_of_platform_devices(void)
 {
-	if (!machine_is(mpc836x_mds))
-		return 0;
-
 	/* Publish the QE devices */
 	of_platform_bus_probe(NULL, mpc836x_ids, NULL);
 
 	return 0;
 }
-device_initcall(mpc836x_declare_of_platform_devices);
+machine_device_initcall(mpc836x_mds, mpc836x_declare_of_platform_devices);
 
 static void __init mpc836x_mds_init_IRQ(void)
 {
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 9cdc32b..cfd0548 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -50,15 +50,12 @@ static struct of_device_id mpc837x_ids[] = {
 
 static int __init mpc837x_declare_of_platform_devices(void)
 {
-	if (!machine_is(mpc837x_mds))
-		return 0;
-
 	/* Publish of_device */
 	of_platform_bus_probe(NULL, mpc837x_ids, NULL);
 
 	return 0;
 }
-device_initcall(mpc837x_declare_of_platform_devices);
+machine_device_initcall(mpc837x_mds, mpc837x_declare_of_platform_devices);
 
 static void __init mpc837x_mds_init_IRQ(void)
 {
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index bccdc25..a3fa1b0 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -233,13 +233,10 @@ static struct of_device_id __initdata of_bus_ids[] = {
 
 static int __init declare_of_platform_devices(void)
 {
-	if (!machine_is(mpc85xx_ads))
-		return 0;
-
 	of_platform_bus_probe(NULL, of_bus_ids, NULL);
 	return 0;
 }
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(mpc85xx_ads, declare_of_platform_devices);
 
 /*
  * Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 4d063ee..8b1de78 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -222,9 +222,6 @@ static int mpc85xx_cds_8259_attach(void)
 	struct device_node *cascade_node = NULL;
 	int cascade_irq;
 
-	if (!machine_is(mpc85xx_cds))
-		return 0;
-
 	/* Initialize the i8259 controller */
 	for_each_node_by_type(np, "interrupt-controller")
 		if (of_device_is_compatible(np, "chrp,iic")) {
@@ -262,8 +259,7 @@ static int mpc85xx_cds_8259_attach(void)
 
 	return 0;
 }
-
-device_initcall(mpc85xx_cds_8259_attach);
+machine_device_initcall(mpc85xx_cds, mpc85xx_cds_8259_attach);
 
 #endif /* CONFIG_PPC_I8259 */
 
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index e6c63a5..9f4f3aa 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -144,15 +144,12 @@ static struct of_device_id mpc85xx_ids[] = {
 
 static int __init mpc85xx_publish_devices(void)
 {
-	if (!machine_is(mpc85xx_mds))
-		return 0;
-
 	/* Publish the QE devices */
 	of_platform_bus_probe(NULL,mpc85xx_ids,NULL);
 
 	return 0;
 }
-device_initcall(mpc85xx_publish_devices);
+machine_device_initcall(mpc85xx_mds, mpc85xx_publish_devices);
 
 static void __init mpc85xx_mds_pic_init(void)
 {
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index d2927a4..d7965f8 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -128,12 +128,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
 
 static int __init declare_of_platform_devices(void)
 {
-	if (machine_is(mpc86x_ads))
-		of_platform_bus_probe(NULL, of_bus_ids, NULL);
+	of_platform_bus_probe(NULL, of_bus_ids, NULL);
 
 	return 0;
 }
-device_initcall(declare_of_platform_devices);
+machine_device_initcall(mpc86x_ads, declare_of_platform_devices);
 
 define_machine(mpc86x_ads) {
 	.name			= "MPC86x ADS",
diff --git a/arch/powerpc/platforms/embedded6xx/ls_uart.c b/arch/powerpc/platforms/embedded6xx/ls_uart.c
index c99264c..9d891bd 100644
--- a/arch/powerpc/platforms/embedded6xx/ls_uart.c
+++ b/arch/powerpc/platforms/embedded6xx/ls_uart.c
@@ -117,9 +117,6 @@ static int __init ls_uarts_init(void)
 	phys_addr_t phys_addr;
 	int len;
 
-	if (!machine_is(linkstation))
-		return 0;
-
 	avr = of_find_node_by_path("/soc10x/serial@80004500");
 	if (!avr)
 		return -EINVAL;
@@ -142,4 +139,4 @@ static int __init ls_uarts_init(void)
 	return 0;
 }
 
-late_initcall(ls_uarts_init);
+machine_late_initcall(linkstation, ls_uarts_init);

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/5] [POWERPC] powermac: Use machine_*_initcall() hooks in platform code
  2008-01-02 19:14 ` [PATCH 1/5] [POWERPC] powermac: Use machine_*_initcall() hooks in platform code Grant Likely
@ 2008-01-02 20:20   ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 11+ messages in thread
From: Benjamin Herrenschmidt @ 2008-01-02 20:20 UTC (permalink / raw)
  To: Grant Likely; +Cc: olof, linuxppc-dev


On Wed, 2008-01-02 at 12:14 -0700, Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
> 
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

Ack.

> 
>  arch/powerpc/platforms/powermac/low_i2c.c    |    7 ++-----
>  arch/powerpc/platforms/powermac/pfunc_base.c |    3 +--
>  arch/powerpc/platforms/powermac/pic.c        |    3 +--
>  arch/powerpc/platforms/powermac/setup.c      |   12 ++----------
>  4 files changed, 6 insertions(+), 19 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
> index da2007e..9c9299c 100644
> --- a/arch/powerpc/platforms/powermac/low_i2c.c
> +++ b/arch/powerpc/platforms/powermac/low_i2c.c
> @@ -1462,9 +1462,6 @@ int __init pmac_i2c_init(void)
>  		return 0;
>  	i2c_inited = 1;
>  
> -	if (!machine_is(powermac))
> -		return 0;
> -
>  	/* Probe keywest-i2c busses */
>  	kw_i2c_probe();
>  
> @@ -1483,7 +1480,7 @@ int __init pmac_i2c_init(void)
>  
>  	return 0;
>  }
> -arch_initcall(pmac_i2c_init);
> +machine_arch_initcall(powermac, pmac_i2c_init);
>  
>  /* Since pmac_i2c_init can be called too early for the platform device
>   * registration, we need to do it at a later time. In our case, subsys
> @@ -1515,4 +1512,4 @@ static int __init pmac_i2c_create_platform_devices(void)
>  
>  	return 0;
>  }
> -subsys_initcall(pmac_i2c_create_platform_devices);
> +machine_subsys_initcall(powermac, pmac_i2c_create_platform_devices);
> diff --git a/arch/powerpc/platforms/powermac/pfunc_base.c b/arch/powerpc/platforms/powermac/pfunc_base.c
> index 45d54b9..db20de5 100644
> --- a/arch/powerpc/platforms/powermac/pfunc_base.c
> +++ b/arch/powerpc/platforms/powermac/pfunc_base.c
> @@ -363,8 +363,7 @@ int __init pmac_pfunc_base_install(void)
>  
>  	return 0;
>  }
> -
> -arch_initcall(pmac_pfunc_base_install);
> +machine_arch_initcall(powermac, pmac_pfunc_base_install);
>  
>  #ifdef CONFIG_PM
>  
> diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
> index 999f5e1..cd72164 100644
> --- a/arch/powerpc/platforms/powermac/pic.c
> +++ b/arch/powerpc/platforms/powermac/pic.c
> @@ -690,6 +690,5 @@ static int __init init_pmacpic_sysfs(void)
>  	sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic);
>  	return 0;
>  }
> -
> -subsys_initcall(init_pmacpic_sysfs);
> +machine_subsys_initcall(powermac, init_pmacpic_sysfs);
>  
> diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
> index adad4e9..36ff1b6 100644
> --- a/arch/powerpc/platforms/powermac/setup.c
> +++ b/arch/powerpc/platforms/powermac/setup.c
> @@ -397,17 +397,13 @@ static int initializing = 1;
>  
>  static int pmac_late_init(void)
>  {
> -	if (!machine_is(powermac))
> -		return -ENODEV;
> -
>  	initializing = 0;
>  	/* this is udbg (which is __init) and we can later use it during
>  	 * cpu hotplug (in smp_core99_kick_cpu) */
>  	ppc_md.progress = NULL;
>  	return 0;
>  }
> -
> -late_initcall(pmac_late_init);
> +machine_late_initcall(powermac, pmac_late_init);
>  
>  /*
>   * This is __init_refok because we check for "initializing" before
> @@ -534,9 +530,6 @@ static int __init pmac_declare_of_platform_devices(void)
>  	if (machine_is(chrp))
>  		return -1;
>  
> -	if (!machine_is(powermac))
> -		return 0;
> -
>  	np = of_find_node_by_name(NULL, "valkyrie");
>  	if (np)
>  		of_platform_device_create(np, "valkyrie", NULL);
> @@ -551,8 +544,7 @@ static int __init pmac_declare_of_platform_devices(void)
>  
>  	return 0;
>  }
> -
> -device_initcall(pmac_declare_of_platform_devices);
> +machine_device_initcall(powermac, pmac_declare_of_platform_devices);
>  
>  /*
>   * Called very early, MMU is off, device-tree isn't unflattened

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/5] [POWERPC] pasemi: Use machine_*_initcall() hooks in platform code
  2008-01-02 19:32 ` [PATCH 3/5] [POWERPC] pasemi: " Grant Likely
@ 2008-01-02 20:30   ` Olof Johansson
  0 siblings, 0 replies; 11+ messages in thread
From: Olof Johansson @ 2008-01-02 20:30 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev

On Wed, Jan 02, 2008 at 12:32:28PM -0700, Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
> 
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> 
>  arch/powerpc/platforms/pasemi/idle.c  |    5 +----
>  arch/powerpc/platforms/pasemi/setup.c |   10 ++--------
>  2 files changed, 3 insertions(+), 12 deletions(-)

Applied to for-2.6.25.

Thanks,

-Olof

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/5] [POWERPC] 8xx: Use machine_*_initcall() hooks in platform code
  2008-01-02 19:32 ` [PATCH 4/5] [POWERPC] 8xx: " Grant Likely
@ 2008-01-03 17:37   ` Scott Wood
  2008-01-03 17:52     ` Grant Likely
  0 siblings, 1 reply; 11+ messages in thread
From: Scott Wood @ 2008-01-03 17:37 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, olof

On Wed, Jan 02, 2008 at 12:32:51PM -0700, Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
> 
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> 
>  arch/powerpc/platforms/8xx/ep88xc.c          |    5 ++---
>  arch/powerpc/platforms/8xx/mpc885ads_setup.c |    5 ++---

How about mpc86xads_setup.c?

-Scott

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/5] [POWERPC] 8xx: Use machine_*_initcall() hooks in platform code
  2008-01-03 17:37   ` Scott Wood
@ 2008-01-03 17:52     ` Grant Likely
  0 siblings, 0 replies; 11+ messages in thread
From: Grant Likely @ 2008-01-03 17:52 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, olof

On 1/3/08, Scott Wood <scottwood@freescale.com> wrote:
> On Wed, Jan 02, 2008 at 12:32:51PM -0700, Grant Likely wrote:
> > From: Grant Likely <grant.likely@secretlab.ca>
> >
> > Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> > ---
> >
> >  arch/powerpc/platforms/8xx/ep88xc.c          |    5 ++---
> >  arch/powerpc/platforms/8xx/mpc885ads_setup.c |    5 ++---
>
> How about mpc86xads_setup.c?

Oops.  I fixed that one too, but it's in the 8xxx patch by mistake.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-01-03 17:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-02 19:14 [PATCH 0/5] Make platform code use machine_*_initcall() macros Grant Likely
2008-01-02 19:14 ` [PATCH 1/5] [POWERPC] powermac: Use machine_*_initcall() hooks in platform code Grant Likely
2008-01-02 20:20   ` Benjamin Herrenschmidt
2008-01-02 19:14 ` [PATCH 2/5] [POWERPC] cell: " Grant Likely
2008-01-02 19:25   ` Arnd Bergmann
2008-01-02 19:32 ` [PATCH 3/5] [POWERPC] pasemi: " Grant Likely
2008-01-02 20:30   ` Olof Johansson
2008-01-02 19:32 ` [PATCH 4/5] [POWERPC] 8xx: " Grant Likely
2008-01-03 17:37   ` Scott Wood
2008-01-03 17:52     ` Grant Likely
2008-01-02 19:33 ` [PATCH 5/5] [POWERPC] 8xxx and embedded6xx: " Grant Likely

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).