[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>
This commit is contained in:
parent
b6a591b2c5
commit
82a03b9227
@ -81,35 +81,7 @@ static void __init efika_setup_arch(void)
|
|||||||
efika_pcisetup();
|
efika_pcisetup();
|
||||||
|
|
||||||
if (ppc_md.progress)
|
if (ppc_md.progress)
|
||||||
ppc_md.progress("Linux/PPC " UTS_RELEASE " runnung on Efika ;-)\n", 0x0);
|
ppc_md.progress("Linux/PPC " UTS_RELEASE " running on Efika ;-)\n", 0x0);
|
||||||
}
|
|
||||||
|
|
||||||
static void __init efika_init(void)
|
|
||||||
{
|
|
||||||
struct device_node *np;
|
|
||||||
struct device_node *cnp = NULL;
|
|
||||||
const u32 *base;
|
|
||||||
|
|
||||||
/* Find every child of the SOC node and add it to of_platform */
|
|
||||||
np = of_find_node_by_name(NULL, "builtin");
|
|
||||||
if (np) {
|
|
||||||
char name[BUS_ID_SIZE];
|
|
||||||
while ((cnp = of_get_next_child(np, cnp))) {
|
|
||||||
strcpy(name, cnp->name);
|
|
||||||
|
|
||||||
base = get_property(cnp, "reg", NULL);
|
|
||||||
if (base == NULL)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
snprintf(name+strlen(name), BUS_ID_SIZE, "@%x", *base);
|
|
||||||
of_platform_device_create(cnp, name, NULL);
|
|
||||||
|
|
||||||
printk(KERN_INFO EFIKA_PLATFORM_NAME" : Added %s (type '%s' at '%s') to the known devices\n", name, cnp->type, cnp->full_name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ppc_md.progress)
|
|
||||||
ppc_md.progress(" Have fun with your Efika! ", 0x7777);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init efika_probe(void)
|
static int __init efika_probe(void)
|
||||||
@ -134,7 +106,7 @@ define_machine(efika)
|
|||||||
.name = EFIKA_PLATFORM_NAME,
|
.name = EFIKA_PLATFORM_NAME,
|
||||||
.probe = efika_probe,
|
.probe = efika_probe,
|
||||||
.setup_arch = efika_setup_arch,
|
.setup_arch = efika_setup_arch,
|
||||||
.init = efika_init,
|
.init = mpc52xx_declare_of_platform_devices,
|
||||||
.show_cpuinfo = efika_show_cpuinfo,
|
.show_cpuinfo = efika_show_cpuinfo,
|
||||||
.init_IRQ = mpc52xx_init_irq,
|
.init_IRQ = mpc52xx_init_irq,
|
||||||
.get_irq = mpc52xx_get_irq,
|
.get_irq = mpc52xx_get_irq,
|
||||||
|
Loading…
Reference in New Issue
Block a user