diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2007-02-12 17:13:22 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-02-12 23:35:53 -0500 |
commit | 82a03b92279f2ea80e11dc2c419fdaa3800401a2 (patch) | |
tree | 0a0761d781c85d2d2f95ea778699127c0e07cee4 | |
parent | b6a591b2c59935eef5dd31790323ca6014e28f01 (diff) |
[POWERPC] Use common 52xx of_platform probe code for EFIKA
Now that the device tree has the good properties, we can
remove all the efika_init code by a single call to common code.
While we're modifying that file, a few whitespaces/alignement/typo
fixes are made (nothing significant).
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/platforms/52xx/efika-setup.c | 64 |
1 files changed, 18 insertions, 46 deletions
diff --git a/arch/powerpc/platforms/52xx/efika-setup.c b/arch/powerpc/platforms/52xx/efika-setup.c index 110c980ed1e0..d61ce84e201f 100644 --- a/arch/powerpc/platforms/52xx/efika-setup.c +++ b/arch/powerpc/platforms/52xx/efika-setup.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * | 2 | * |
3 | * Efika 5K2 platform setup | 3 | * Efika 5K2 platform setup |
4 | * Some code really inspired from the lite5200b platform. | 4 | * Some code really inspired from the lite5200b platform. |
5 | * | 5 | * |
6 | * Copyright (C) 2006 bplan GmbH | 6 | * Copyright (C) 2006 bplan GmbH |
7 | * | 7 | * |
8 | * This file is licensed under the terms of the GNU General Public License | 8 | * This file is licensed under the terms of the GNU General Public License |
@@ -81,35 +81,7 @@ static void __init efika_setup_arch(void) | |||
81 | efika_pcisetup(); | 81 | efika_pcisetup(); |
82 | 82 | ||
83 | if (ppc_md.progress) | 83 | if (ppc_md.progress) |
84 | ppc_md.progress("Linux/PPC " UTS_RELEASE " runnung on Efika ;-)\n", 0x0); | 84 | ppc_md.progress("Linux/PPC " UTS_RELEASE " running on Efika ;-)\n", 0x0); |
85 | } | ||
86 | |||
87 | static void __init efika_init(void) | ||
88 | { | ||
89 | struct device_node *np; | ||
90 | struct device_node *cnp = NULL; | ||
91 | const u32 *base; | ||
92 | |||
93 | /* Find every child of the SOC node and add it to of_platform */ | ||
94 | np = of_find_node_by_name(NULL, "builtin"); | ||
95 | if (np) { | ||
96 | char name[BUS_ID_SIZE]; | ||
97 | while ((cnp = of_get_next_child(np, cnp))) { | ||
98 | strcpy(name, cnp->name); | ||
99 | |||
100 | base = get_property(cnp, "reg", NULL); | ||
101 | if (base == NULL) | ||
102 | continue; | ||
103 | |||
104 | snprintf(name+strlen(name), BUS_ID_SIZE, "@%x", *base); | ||
105 | of_platform_device_create(cnp, name, NULL); | ||
106 | |||
107 | printk(KERN_INFO EFIKA_PLATFORM_NAME" : Added %s (type '%s' at '%s') to the known devices\n", name, cnp->type, cnp->full_name); | ||
108 | } | ||
109 | } | ||
110 | |||
111 | if (ppc_md.progress) | ||
112 | ppc_md.progress(" Have fun with your Efika! ", 0x7777); | ||
113 | } | 85 | } |
114 | 86 | ||
115 | static int __init efika_probe(void) | 87 | static int __init efika_probe(void) |
@@ -131,20 +103,20 @@ static int __init efika_probe(void) | |||
131 | 103 | ||
132 | define_machine(efika) | 104 | define_machine(efika) |
133 | { | 105 | { |
134 | .name = EFIKA_PLATFORM_NAME, | 106 | .name = EFIKA_PLATFORM_NAME, |
135 | .probe = efika_probe, | 107 | .probe = efika_probe, |
136 | .setup_arch = efika_setup_arch, | 108 | .setup_arch = efika_setup_arch, |
137 | .init = efika_init, | 109 | .init = mpc52xx_declare_of_platform_devices, |
138 | .show_cpuinfo = efika_show_cpuinfo, | 110 | .show_cpuinfo = efika_show_cpuinfo, |
139 | .init_IRQ = mpc52xx_init_irq, | 111 | .init_IRQ = mpc52xx_init_irq, |
140 | .get_irq = mpc52xx_get_irq, | 112 | .get_irq = mpc52xx_get_irq, |
141 | .restart = rtas_restart, | 113 | .restart = rtas_restart, |
142 | .power_off = rtas_power_off, | 114 | .power_off = rtas_power_off, |
143 | .halt = rtas_halt, | 115 | .halt = rtas_halt, |
144 | .set_rtc_time = rtas_set_rtc_time, | 116 | .set_rtc_time = rtas_set_rtc_time, |
145 | .get_rtc_time = rtas_get_rtc_time, | 117 | .get_rtc_time = rtas_get_rtc_time, |
146 | .progress = rtas_progress, | 118 | .progress = rtas_progress, |
147 | .get_boot_time = rtas_get_boot_time, | 119 | .get_boot_time = rtas_get_boot_time, |
148 | .calibrate_decr = generic_calibrate_decr, | 120 | .calibrate_decr = generic_calibrate_decr, |
149 | .phys_mem_access_prot = pci_phys_mem_access_prot, | 121 | .phys_mem_access_prot = pci_phys_mem_access_prot, |
150 | }; | 122 | }; |