Commit 56571384 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Michael Ellerman

powerpc: Move 32-bit probe() machine to later in the boot process

This converts all the 32-bit platforms to use the expanded device-tree
which is a pretty mechanical change. Unlike 64-bit, the 32-bit kernel
didn't rely on platform initializations to setup the MMU since it
sets it up entirely before probe_machine() so the move has comparatively
less consequences though it's a bigger patch.
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 406b0b6a
...@@ -113,23 +113,7 @@ notrace void __init machine_init(u64 dt_ptr) ...@@ -113,23 +113,7 @@ notrace void __init machine_init(u64 dt_ptr)
early_init_mmu(); early_init_mmu();
probe_machine();
setup_kdump_trampoline(); setup_kdump_trampoline();
#ifdef CONFIG_6xx
if (cpu_has_feature(CPU_FTR_CAN_DOZE) ||
cpu_has_feature(CPU_FTR_CAN_NAP))
ppc_md.power_save = ppc6xx_idle;
#endif
#ifdef CONFIG_E500
if (cpu_has_feature(CPU_FTR_CAN_DOZE) ||
cpu_has_feature(CPU_FTR_CAN_NAP))
ppc_md.power_save = e500_idle;
#endif
if (ppc_md.progress)
ppc_md.progress("id mach(): done", 0x200);
} }
/* Checks "l2cr=xxxx" command-line option */ /* Checks "l2cr=xxxx" command-line option */
...@@ -249,6 +233,21 @@ static void __init exc_lvl_early_init(void) ...@@ -249,6 +233,21 @@ static void __init exc_lvl_early_init(void)
#define exc_lvl_early_init() #define exc_lvl_early_init()
#endif #endif
static void setup_power_save(void)
{
#ifdef CONFIG_6xx
if (cpu_has_feature(CPU_FTR_CAN_DOZE) ||
cpu_has_feature(CPU_FTR_CAN_NAP))
ppc_md.power_save = ppc6xx_idle;
#endif
#ifdef CONFIG_E500
if (cpu_has_feature(CPU_FTR_CAN_DOZE) ||
cpu_has_feature(CPU_FTR_CAN_NAP))
ppc_md.power_save = e500_idle;
#endif
}
/* Warning, IO base is not yet inited */ /* Warning, IO base is not yet inited */
void __init setup_arch(char **cmdline_p) void __init setup_arch(char **cmdline_p)
{ {
...@@ -260,6 +259,10 @@ void __init setup_arch(char **cmdline_p) ...@@ -260,6 +259,10 @@ void __init setup_arch(char **cmdline_p)
unflatten_device_tree(); unflatten_device_tree();
check_for_initrd(); check_for_initrd();
probe_machine();
setup_power_save();
if (ppc_md.init_early) if (ppc_md.init_early)
ppc_md.init_early(); ppc_md.init_early();
......
...@@ -105,9 +105,7 @@ static void __init ep405_setup_arch(void) ...@@ -105,9 +105,7 @@ static void __init ep405_setup_arch(void)
static int __init ep405_probe(void) static int __init ep405_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (!of_machine_is_compatible("ep405"))
if (!of_flat_dt_is_compatible(root, "ep405"))
return 0; return 0;
return 1; return 1;
......
...@@ -63,7 +63,7 @@ static const char * const board[] __initconst = { ...@@ -63,7 +63,7 @@ static const char * const board[] __initconst = {
static int __init ppc40x_probe(void) static int __init ppc40x_probe(void)
{ {
if (of_flat_dt_match(of_get_flat_dt_root(), board)) { if (of_device_compatible_match(of_root, board)) {
pci_set_flags(PCI_REASSIGN_ALL_RSRC); pci_set_flags(PCI_REASSIGN_ALL_RSRC);
return 1; return 1;
} }
......
...@@ -37,9 +37,7 @@ machine_device_initcall(virtex, virtex_device_probe); ...@@ -37,9 +37,7 @@ machine_device_initcall(virtex, virtex_device_probe);
static int __init virtex_probe(void) static int __init virtex_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (!of_machine_is_compatible("xlnx,virtex"))
if (!of_flat_dt_is_compatible(root, "xlnx,virtex"))
return 0; return 0;
return 1; return 1;
......
...@@ -46,9 +46,7 @@ machine_device_initcall(walnut, walnut_device_probe); ...@@ -46,9 +46,7 @@ machine_device_initcall(walnut, walnut_device_probe);
static int __init walnut_probe(void) static int __init walnut_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (!of_machine_is_compatible("ibm,walnut"))
if (!of_flat_dt_is_compatible(root, "ibm,walnut"))
return 0; return 0;
pci_set_flags(PCI_REASSIGN_ALL_RSRC); pci_set_flags(PCI_REASSIGN_ALL_RSRC);
......
...@@ -53,11 +53,10 @@ machine_device_initcall(canyonlands, ppc460ex_device_probe); ...@@ -53,11 +53,10 @@ machine_device_initcall(canyonlands, ppc460ex_device_probe);
static int __init ppc460ex_probe(void) static int __init ppc460ex_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (of_machine_is_compatible("amcc,canyonlands")) {
if (of_flat_dt_is_compatible(root, "amcc,canyonlands")) {
pci_set_flags(PCI_REASSIGN_ALL_RSRC); pci_set_flags(PCI_REASSIGN_ALL_RSRC);
return 1; return 1;
} }
return 0; return 0;
} }
......
...@@ -49,9 +49,7 @@ machine_device_initcall(ebony, ebony_device_probe); ...@@ -49,9 +49,7 @@ machine_device_initcall(ebony, ebony_device_probe);
*/ */
static int __init ebony_probe(void) static int __init ebony_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (!of_machine_is_compatible("ibm,ebony"))
if (!of_flat_dt_is_compatible(root, "ibm,ebony"))
return 0; return 0;
pci_set_flags(PCI_REASSIGN_ALL_RSRC); pci_set_flags(PCI_REASSIGN_ALL_RSRC);
......
...@@ -149,9 +149,7 @@ static void __init iss4xx_setup_arch(void) ...@@ -149,9 +149,7 @@ static void __init iss4xx_setup_arch(void)
*/ */
static int __init iss4xx_probe(void) static int __init iss4xx_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (!of_machine_is_compatible("ibm,iss-4xx"))
if (!of_flat_dt_is_compatible(root, "ibm,iss-4xx"))
return 0; return 0;
return 1; return 1;
......
...@@ -67,11 +67,10 @@ static char *board[] __initdata = { ...@@ -67,11 +67,10 @@ static char *board[] __initdata = {
static int __init ppc44x_probe(void) static int __init ppc44x_probe(void)
{ {
unsigned long root = of_get_flat_dt_root();
int i = 0; int i = 0;
for (i = 0; i < ARRAY_SIZE(board); i++) { for (i = 0; i < ARRAY_SIZE(board); i++) {
if (of_flat_dt_is_compatible(root, board[i])) { if (of_machine_is_compatible(board[i])) {
pci_set_flags(PCI_REASSIGN_ALL_RSRC); pci_set_flags(PCI_REASSIGN_ALL_RSRC);
return 1; return 1;
} }
......
...@@ -275,12 +275,10 @@ static void ppc47x_pci_irq_fixup(struct pci_dev *dev) ...@@ -275,12 +275,10 @@ static void ppc47x_pci_irq_fixup(struct pci_dev *dev)
*/ */
static int __init ppc47x_probe(void) static int __init ppc47x_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (of_machine_is_compatible("ibm,akebono"))
if (of_flat_dt_is_compatible(root, "ibm,akebono"))
return 1; return 1;
if (of_flat_dt_is_compatible(root, "ibm,currituck")) { if (of_machine_is_compatible("ibm,currituck")) {
ppc_md.pci_irq_fixup = ppc47x_pci_irq_fixup; ppc_md.pci_irq_fixup = ppc47x_pci_irq_fixup;
return 1; return 1;
} }
......
...@@ -46,9 +46,7 @@ machine_device_initcall(sam440ep, sam440ep_device_probe); ...@@ -46,9 +46,7 @@ machine_device_initcall(sam440ep, sam440ep_device_probe);
static int __init sam440ep_probe(void) static int __init sam440ep_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (!of_machine_is_compatible("acube,sam440ep"))
if (!of_flat_dt_is_compatible(root, "acube,sam440ep"))
return 0; return 0;
pci_set_flags(PCI_REASSIGN_ALL_RSRC); pci_set_flags(PCI_REASSIGN_ALL_RSRC);
......
...@@ -43,9 +43,7 @@ machine_device_initcall(virtex, virtex_device_probe); ...@@ -43,9 +43,7 @@ machine_device_initcall(virtex, virtex_device_probe);
static int __init virtex_probe(void) static int __init virtex_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (!of_machine_is_compatible("xlnx,virtex440"))
if (!of_flat_dt_is_compatible(root, "xlnx,virtex440"))
return 0; return 0;
return 1; return 1;
......
...@@ -44,9 +44,7 @@ machine_device_initcall(warp, warp_device_probe); ...@@ -44,9 +44,7 @@ machine_device_initcall(warp, warp_device_probe);
static int __init warp_probe(void) static int __init warp_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (!of_machine_is_compatible("pika,warp"))
if (!of_flat_dt_is_compatible(root, "pika,warp"))
return 0; return 0;
/* For __dma_alloc_coherent */ /* For __dma_alloc_coherent */
......
...@@ -57,9 +57,7 @@ static void __init mpc5121_ads_init_IRQ(void) ...@@ -57,9 +57,7 @@ static void __init mpc5121_ads_init_IRQ(void)
*/ */
static int __init mpc5121_ads_probe(void) static int __init mpc5121_ads_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,mpc5121ads");
return of_flat_dt_is_compatible(root, "fsl,mpc5121ads");
} }
define_machine(mpc5121_ads) { define_machine(mpc5121_ads) {
......
...@@ -38,7 +38,7 @@ static const char * const board[] __initconst = { ...@@ -38,7 +38,7 @@ static const char * const board[] __initconst = {
*/ */
static int __init mpc512x_generic_probe(void) static int __init mpc512x_generic_probe(void)
{ {
return of_flat_dt_match(of_get_flat_dt_root(), board); return of_device_compatible_match(of_root, board);
} }
define_machine(mpc512x_generic) { define_machine(mpc512x_generic) {
......
...@@ -113,9 +113,7 @@ void __init pdm360ng_init(void) ...@@ -113,9 +113,7 @@ void __init pdm360ng_init(void)
static int __init pdm360ng_probe(void) static int __init pdm360ng_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("ifm,pdm360ng");
return of_flat_dt_is_compatible(root, "ifm,pdm360ng");
} }
define_machine(pdm360ng) { define_machine(pdm360ng) {
......
...@@ -200,8 +200,7 @@ static void __init efika_setup_arch(void) ...@@ -200,8 +200,7 @@ static void __init efika_setup_arch(void)
static int __init efika_probe(void) static int __init efika_probe(void)
{ {
const char *model = of_get_flat_dt_prop(of_get_flat_dt_root(), const char *model = of_get_property(of_root, "model", NULL);
"model", NULL);
if (model == NULL) if (model == NULL)
return 0; return 0;
......
...@@ -183,7 +183,7 @@ static const char * const board[] __initconst = { ...@@ -183,7 +183,7 @@ static const char * const board[] __initconst = {
*/ */
static int __init lite5200_probe(void) static int __init lite5200_probe(void)
{ {
return of_flat_dt_match(of_get_flat_dt_root(), board); return of_device_compatible_match(of_root, board);
} }
define_machine(lite5200) { define_machine(lite5200) {
......
...@@ -242,7 +242,7 @@ static const char * const board[] __initconst = { ...@@ -242,7 +242,7 @@ static const char * const board[] __initconst = {
*/ */
static int __init media5200_probe(void) static int __init media5200_probe(void)
{ {
return of_flat_dt_match(of_get_flat_dt_root(), board); return of_device_compatible_match(of_root, board);
} }
define_machine(media5200_platform) { define_machine(media5200_platform) {
......
...@@ -70,7 +70,7 @@ static const char *board[] __initdata = { ...@@ -70,7 +70,7 @@ static const char *board[] __initdata = {
*/ */
static int __init mpc5200_simple_probe(void) static int __init mpc5200_simple_probe(void)
{ {
return of_flat_dt_match(of_get_flat_dt_root(), board); return of_device_compatible_match(of_root, board);
} }
define_machine(mpc5200_simple_platform) { define_machine(mpc5200_simple_platform) {
......
...@@ -309,8 +309,7 @@ machine_device_initcall(ep8248e, declare_of_platform_devices); ...@@ -309,8 +309,7 @@ machine_device_initcall(ep8248e, declare_of_platform_devices);
*/ */
static int __init ep8248e_probe(void) static int __init ep8248e_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,ep8248e");
return of_flat_dt_is_compatible(root, "fsl,ep8248e");
} }
define_machine(ep8248e) define_machine(ep8248e)
......
...@@ -198,8 +198,7 @@ machine_device_initcall(km82xx, declare_of_platform_devices); ...@@ -198,8 +198,7 @@ machine_device_initcall(km82xx, declare_of_platform_devices);
*/ */
static int __init km82xx_probe(void) static int __init km82xx_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("keymile,km82xx");
return of_flat_dt_is_compatible(root, "keymile,km82xx");
} }
define_machine(km82xx) define_machine(km82xx)
......
...@@ -201,8 +201,7 @@ machine_device_initcall(mpc8272_ads, declare_of_platform_devices); ...@@ -201,8 +201,7 @@ machine_device_initcall(mpc8272_ads, declare_of_platform_devices);
*/ */
static int __init mpc8272_ads_probe(void) static int __init mpc8272_ads_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,mpc8272ads");
return of_flat_dt_is_compatible(root, "fsl,mpc8272ads");
} }
define_machine(mpc8272_ads) define_machine(mpc8272_ads)
......
...@@ -164,8 +164,7 @@ static void __init pq2fads_setup_arch(void) ...@@ -164,8 +164,7 @@ static void __init pq2fads_setup_arch(void)
*/ */
static int __init pq2fads_probe(void) static int __init pq2fads_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,pq2fads");
return of_flat_dt_is_compatible(root, "fsl,pq2fads");
} }
static const struct of_device_id of_bus_ids[] __initconst = { static const struct of_device_id of_bus_ids[] __initconst = {
......
...@@ -43,8 +43,7 @@ machine_device_initcall(asp834x, mpc83xx_declare_of_platform_devices); ...@@ -43,8 +43,7 @@ machine_device_initcall(asp834x, mpc83xx_declare_of_platform_devices);
*/ */
static int __init asp834x_probe(void) static int __init asp834x_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("analogue-and-micro,asp8347e");
return of_flat_dt_is_compatible(root, "analogue-and-micro,asp8347e");
} }
define_machine(asp834x) { define_machine(asp834x) {
......
...@@ -171,11 +171,10 @@ static char *board[] __initdata = { ...@@ -171,11 +171,10 @@ static char *board[] __initdata = {
*/ */
static int __init mpc83xx_km_probe(void) static int __init mpc83xx_km_probe(void)
{ {
unsigned long node = of_get_flat_dt_root();
int i = 0; int i = 0;
while (board[i]) { while (board[i]) {
if (of_flat_dt_is_compatible(node, board[i])) if (of_machine_is_compatible(board[i]))
break; break;
i++; i++;
} }
......
...@@ -46,7 +46,7 @@ static const char *board[] __initdata = { ...@@ -46,7 +46,7 @@ static const char *board[] __initdata = {
*/ */
static int __init mpc830x_rdb_probe(void) static int __init mpc830x_rdb_probe(void)
{ {
return of_flat_dt_match(of_get_flat_dt_root(), board); return of_device_compatible_match(of_root, board);
} }
machine_device_initcall(mpc830x_rdb, mpc83xx_declare_of_platform_devices); machine_device_initcall(mpc830x_rdb, mpc83xx_declare_of_platform_devices);
......
...@@ -46,7 +46,7 @@ static const char *board[] __initdata = { ...@@ -46,7 +46,7 @@ static const char *board[] __initdata = {
*/ */
static int __init mpc831x_rdb_probe(void) static int __init mpc831x_rdb_probe(void)
{ {
return of_flat_dt_match(of_get_flat_dt_root(), board); return of_device_compatible_match(of_root, board);
} }
machine_device_initcall(mpc831x_rdb, mpc83xx_declare_of_platform_devices); machine_device_initcall(mpc831x_rdb, mpc83xx_declare_of_platform_devices);
......
...@@ -102,9 +102,7 @@ machine_device_initcall(mpc832x_mds, mpc83xx_declare_of_platform_devices); ...@@ -102,9 +102,7 @@ machine_device_initcall(mpc832x_mds, mpc83xx_declare_of_platform_devices);
*/ */
static int __init mpc832x_sys_probe(void) static int __init mpc832x_sys_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("MPC832xMDS");
return of_flat_dt_is_compatible(root, "MPC832xMDS");
} }
define_machine(mpc832x_mds) { define_machine(mpc832x_mds) {
......
...@@ -220,9 +220,7 @@ machine_device_initcall(mpc832x_rdb, mpc83xx_declare_of_platform_devices); ...@@ -220,9 +220,7 @@ machine_device_initcall(mpc832x_rdb, mpc83xx_declare_of_platform_devices);
*/ */
static int __init mpc832x_rdb_probe(void) static int __init mpc832x_rdb_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("MPC832xRDB");
return of_flat_dt_is_compatible(root, "MPC832xRDB");
} }
define_machine(mpc832x_rdb) { define_machine(mpc832x_rdb) {
......
...@@ -70,9 +70,7 @@ static void __init mpc834x_itx_setup_arch(void) ...@@ -70,9 +70,7 @@ static void __init mpc834x_itx_setup_arch(void)
*/ */
static int __init mpc834x_itx_probe(void) static int __init mpc834x_itx_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("MPC834xMITX");
return of_flat_dt_is_compatible(root, "MPC834xMITX");
} }
define_machine(mpc834x_itx) { define_machine(mpc834x_itx) {
......
...@@ -91,9 +91,7 @@ machine_device_initcall(mpc834x_mds, mpc83xx_declare_of_platform_devices); ...@@ -91,9 +91,7 @@ machine_device_initcall(mpc834x_mds, mpc83xx_declare_of_platform_devices);
*/ */
static int __init mpc834x_mds_probe(void) static int __init mpc834x_mds_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("MPC834xMDS");
return of_flat_dt_is_compatible(root, "MPC834xMDS");
} }
define_machine(mpc834x_mds) { define_machine(mpc834x_mds) {
......
...@@ -209,9 +209,7 @@ machine_arch_initcall(mpc836x_mds, mpc836x_usb_cfg); ...@@ -209,9 +209,7 @@ machine_arch_initcall(mpc836x_mds, mpc836x_usb_cfg);
*/ */
static int __init mpc836x_mds_probe(void) static int __init mpc836x_mds_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("MPC836xMDS");
return of_flat_dt_is_compatible(root, "MPC836xMDS");
} }
define_machine(mpc836x_mds) { define_machine(mpc836x_mds) {
......
...@@ -42,9 +42,7 @@ static void __init mpc836x_rdk_setup_arch(void) ...@@ -42,9 +42,7 @@ static void __init mpc836x_rdk_setup_arch(void)
*/ */
static int __init mpc836x_rdk_probe(void) static int __init mpc836x_rdk_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,mpc8360rdk");
return of_flat_dt_is_compatible(root, "fsl,mpc8360rdk");
} }
define_machine(mpc836x_rdk) { define_machine(mpc836x_rdk) {
......
...@@ -93,9 +93,7 @@ machine_device_initcall(mpc837x_mds, mpc83xx_declare_of_platform_devices); ...@@ -93,9 +93,7 @@ machine_device_initcall(mpc837x_mds, mpc83xx_declare_of_platform_devices);
*/ */
static int __init mpc837x_mds_probe(void) static int __init mpc837x_mds_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,mpc837xmds");
return of_flat_dt_is_compatible(root, "fsl,mpc837xmds");
} }
define_machine(mpc837x_mds) { define_machine(mpc837x_mds) {
......
...@@ -73,7 +73,7 @@ static const char * const board[] __initconst = { ...@@ -73,7 +73,7 @@ static const char * const board[] __initconst = {
*/ */
static int __init mpc837x_rdb_probe(void) static int __init mpc837x_rdb_probe(void)
{ {
return of_flat_dt_match(of_get_flat_dt_root(), board); return of_device_compatible_match(of_root, board);
} }
define_machine(mpc837x_rdb) { define_machine(mpc837x_rdb) {
......
...@@ -60,9 +60,7 @@ machine_device_initcall(sbc834x, mpc83xx_declare_of_platform_devices); ...@@ -60,9 +60,7 @@ machine_device_initcall(sbc834x, mpc83xx_declare_of_platform_devices);
*/ */
static int __init sbc834x_probe(void) static int __init sbc834x_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("SBC834xE");
return of_flat_dt_is_compatible(root, "SBC834xE");
} }
define_machine(sbc834x) { define_machine(sbc834x) {
......
...@@ -60,9 +60,7 @@ machine_arch_initcall(bsc9132_qds, mpc85xx_common_publish_devices); ...@@ -60,9 +60,7 @@ machine_arch_initcall(bsc9132_qds, mpc85xx_common_publish_devices);
static int __init bsc9132_qds_probe(void) static int __init bsc9132_qds_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,bsc9132qds");
return of_flat_dt_is_compatible(root, "fsl,bsc9132qds");
} }
define_machine(bsc9132_qds) { define_machine(bsc9132_qds) {
......
...@@ -50,9 +50,7 @@ machine_device_initcall(bsc9131_rdb, mpc85xx_common_publish_devices); ...@@ -50,9 +50,7 @@ machine_device_initcall(bsc9131_rdb, mpc85xx_common_publish_devices);
static int __init bsc9131_rdb_probe(void) static int __init bsc9131_rdb_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,bsc9131rdb");
return of_flat_dt_is_compatible(root, "fsl,bsc9131rdb");
} }
define_machine(bsc9131_rdb) { define_machine(bsc9131_rdb) {
......
...@@ -54,9 +54,7 @@ machine_arch_initcall(c293_pcie, mpc85xx_common_publish_devices); ...@@ -54,9 +54,7 @@ machine_arch_initcall(c293_pcie, mpc85xx_common_publish_devices);
*/ */
static int __init c293_pcie_probe(void) static int __init c293_pcie_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (of_machine_is_compatible("fsl,C293PCIE"))
if (of_flat_dt_is_compatible(root, "fsl,C293PCIE"))
return 1; return 1;
return 0; return 0;
} }
......
...@@ -170,20 +170,19 @@ static const char * const boards[] __initconst = { ...@@ -170,20 +170,19 @@ static const char * const boards[] __initconst = {
*/ */
static int __init corenet_generic_probe(void) static int __init corenet_generic_probe(void)
{ {
unsigned long root = of_get_flat_dt_root();
char hv_compat[24]; char hv_compat[24];
int i; int i;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
extern struct smp_ops_t smp_85xx_ops; extern struct smp_ops_t smp_85xx_ops;
#endif #endif
if (of_flat_dt_match(root, boards)) if (of_device_compatible_match(of_root, boards))
return 1; return 1;
/* Check if we're running under the Freescale hypervisor */ /* Check if we're running under the Freescale hypervisor */
for (i = 0; boards[i]; i++) { for (i = 0; boards[i]; i++) {
snprintf(hv_compat, sizeof(hv_compat), "%s-hv", boards[i]); snprintf(hv_compat, sizeof(hv_compat), "%s-hv", boards[i]);
if (of_flat_dt_is_compatible(root, hv_compat)) { if (of_machine_is_compatible(hv_compat)) {
ppc_md.init_IRQ = ehv_pic_init; ppc_md.init_IRQ = ehv_pic_init;
ppc_md.get_irq = ehv_pic_get_irq; ppc_md.get_irq = ehv_pic_get_irq;
......
...@@ -197,9 +197,7 @@ static void ge_imp3a_show_cpuinfo(struct seq_file *m) ...@@ -197,9 +197,7 @@ static void ge_imp3a_show_cpuinfo(struct seq_file *m)
*/ */
static int __init ge_imp3a_probe(void) static int __init ge_imp3a_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("ge,IMP3A");
return of_flat_dt_is_compatible(root, "ge,IMP3A");
} }
machine_arch_initcall(ge_imp3a, mpc85xx_common_publish_devices); machine_arch_initcall(ge_imp3a, mpc85xx_common_publish_devices);
......
...@@ -176,9 +176,7 @@ machine_device_initcall(ksi8560, mpc85xx_common_publish_devices); ...@@ -176,9 +176,7 @@ machine_device_initcall(ksi8560, mpc85xx_common_publish_devices);
*/ */
static int __init ksi8560_probe(void) static int __init ksi8560_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("emerson,KSI8560");
return of_flat_dt_is_compatible(root, "emerson,KSI8560");
} }
define_machine(ksi8560) { define_machine(ksi8560) {
......
...@@ -64,9 +64,7 @@ machine_arch_initcall(mpc8536_ds, swiotlb_setup_bus_notifier); ...@@ -64,9 +64,7 @@ machine_arch_initcall(mpc8536_ds, swiotlb_setup_bus_notifier);
*/ */
static int __init mpc8536_ds_probe(void) static int __init mpc8536_ds_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,mpc8536ds");
return of_flat_dt_is_compatible(root, "fsl,mpc8536ds");
} }
define_machine(mpc8536_ds) { define_machine(mpc8536_ds) {
......
...@@ -160,9 +160,7 @@ machine_arch_initcall(mpc85xx_ads, mpc85xx_common_publish_devices); ...@@ -160,9 +160,7 @@ machine_arch_initcall(mpc85xx_ads, mpc85xx_common_publish_devices);
*/ */
static int __init mpc85xx_ads_probe(void) static int __init mpc85xx_ads_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("MPC85xxADS");
return of_flat_dt_is_compatible(root, "MPC85xxADS");
} }
define_machine(mpc85xx_ads) { define_machine(mpc85xx_ads) {
......
...@@ -367,9 +367,7 @@ static void mpc85xx_cds_show_cpuinfo(struct seq_file *m) ...@@ -367,9 +367,7 @@ static void mpc85xx_cds_show_cpuinfo(struct seq_file *m)
*/ */
static int __init mpc85xx_cds_probe(void) static int __init mpc85xx_cds_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("MPC85xxCDS");
return of_flat_dt_is_compatible(root, "MPC85xxCDS");
} }
machine_arch_initcall(mpc85xx_cds, mpc85xx_common_publish_devices); machine_arch_initcall(mpc85xx_cds, mpc85xx_common_publish_devices);
......
...@@ -167,9 +167,7 @@ static void __init mpc85xx_ds_setup_arch(void) ...@@ -167,9 +167,7 @@ static void __init mpc85xx_ds_setup_arch(void)
*/ */
static int __init mpc8544_ds_probe(void) static int __init mpc8544_ds_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return !!of_machine_is_compatible("MPC8544DS");
return !!of_flat_dt_is_compatible(root, "MPC8544DS");
} }
machine_arch_initcall(mpc8544_ds, mpc85xx_common_publish_devices); machine_arch_initcall(mpc8544_ds, mpc85xx_common_publish_devices);
...@@ -185,9 +183,7 @@ machine_arch_initcall(p2020_ds, swiotlb_setup_bus_notifier); ...@@ -185,9 +183,7 @@ machine_arch_initcall(p2020_ds, swiotlb_setup_bus_notifier);
*/ */
static int __init mpc8572_ds_probe(void) static int __init mpc8572_ds_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return !!of_machine_is_compatible("fsl,MPC8572DS");
return !!of_flat_dt_is_compatible(root, "fsl,MPC8572DS");
} }
/* /*
...@@ -195,9 +191,7 @@ static int __init mpc8572_ds_probe(void) ...@@ -195,9 +191,7 @@ static int __init mpc8572_ds_probe(void)
*/ */
static int __init p2020_ds_probe(void) static int __init p2020_ds_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return !!of_machine_is_compatible("fsl,P2020DS");
return !!of_flat_dt_is_compatible(root, "fsl,P2020DS");
} }
define_machine(mpc8544_ds) { define_machine(mpc8544_ds) {
......
...@@ -376,9 +376,7 @@ static void __init mpc85xx_mds_pic_init(void) ...@@ -376,9 +376,7 @@ static void __init mpc85xx_mds_pic_init(void)
static int __init mpc85xx_mds_probe(void) static int __init mpc85xx_mds_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("MPC85xxMDS");
return of_flat_dt_is_compatible(root, "MPC85xxMDS");
} }
define_machine(mpc8568_mds) { define_machine(mpc8568_mds) {
...@@ -398,9 +396,7 @@ define_machine(mpc8568_mds) { ...@@ -398,9 +396,7 @@ define_machine(mpc8568_mds) {
static int __init mpc8569_mds_probe(void) static int __init mpc8569_mds_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,MPC8569EMDS");
return of_flat_dt_is_compatible(root, "fsl,MPC8569EMDS");
} }
define_machine(mpc8569_mds) { define_machine(mpc8569_mds) {
...@@ -420,9 +416,7 @@ define_machine(mpc8569_mds) { ...@@ -420,9 +416,7 @@ define_machine(mpc8569_mds) {
static int __init p1021_mds_probe(void) static int __init p1021_mds_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,P1021MDS");
return of_flat_dt_is_compatible(root, "fsl,P1021MDS");
} }
......
...@@ -147,80 +147,60 @@ machine_arch_initcall(p1024_rdb, mpc85xx_common_publish_devices); ...@@ -147,80 +147,60 @@ machine_arch_initcall(p1024_rdb, mpc85xx_common_publish_devices);
*/ */
static int __init p2020_rdb_probe(void) static int __init p2020_rdb_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (of_machine_is_compatible("fsl,P2020RDB"))
if (of_flat_dt_is_compatible(root, "fsl,P2020RDB"))
return 1; return 1;
return 0; return 0;
} }
static int __init p1020_rdb_probe(void) static int __init p1020_rdb_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (of_machine_is_compatible("fsl,P1020RDB"))
if (of_flat_dt_is_compatible(root, "fsl,P1020RDB"))
return 1; return 1;
return 0; return 0;
} }
static int __init p1020_rdb_pc_probe(void) static int __init p1020_rdb_pc_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,P1020RDB-PC");
return of_flat_dt_is_compatible(root, "fsl,P1020RDB-PC");
} }
static int __init p1020_rdb_pd_probe(void) static int __init p1020_rdb_pd_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,P1020RDB-PD");
return of_flat_dt_is_compatible(root, "fsl,P1020RDB-PD");
} }
static int __init p1021_rdb_pc_probe(void) static int __init p1021_rdb_pc_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (of_machine_is_compatible("fsl,P1021RDB-PC"))
if (of_flat_dt_is_compatible(root, "fsl,P1021RDB-PC"))
return 1; return 1;
return 0; return 0;
} }
static int __init p2020_rdb_pc_probe(void) static int __init p2020_rdb_pc_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (of_machine_is_compatible("fsl,P2020RDB-PC"))
if (of_flat_dt_is_compatible(root, "fsl,P2020RDB-PC"))
return 1; return 1;
return 0; return 0;
} }
static int __init p1025_rdb_probe(void) static int __init p1025_rdb_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,P1025RDB");
return of_flat_dt_is_compatible(root, "fsl,P1025RDB");
} }
static int __init p1020_mbg_pc_probe(void) static int __init p1020_mbg_pc_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,P1020MBG-PC");
return of_flat_dt_is_compatible(root, "fsl,P1020MBG-PC");
} }
static int __init p1020_utm_pc_probe(void) static int __init p1020_utm_pc_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,P1020UTM-PC");
return of_flat_dt_is_compatible(root, "fsl,P1020UTM-PC");
} }
static int __init p1024_rdb_probe(void) static int __init p1024_rdb_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,P1024RDB");
return of_flat_dt_is_compatible(root, "fsl,P1024RDB");
} }
define_machine(p2020_rdb) { define_machine(p2020_rdb) {
......
...@@ -53,9 +53,7 @@ machine_arch_initcall(mvme2500, mpc85xx_common_publish_devices); ...@@ -53,9 +53,7 @@ machine_arch_initcall(mvme2500, mpc85xx_common_publish_devices);
*/ */
static int __init mvme2500_probe(void) static int __init mvme2500_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("artesyn,MVME2500");
return of_flat_dt_is_compatible(root, "artesyn,MVME2500");
} }
define_machine(mvme2500) { define_machine(mvme2500) {
......
...@@ -62,11 +62,9 @@ machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier); ...@@ -62,11 +62,9 @@ machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier);
*/ */
static int __init p1010_rdb_probe(void) static int __init p1010_rdb_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (of_machine_is_compatible("fsl,P1010RDB"))
if (of_flat_dt_is_compatible(root, "fsl,P1010RDB"))
return 1; return 1;
if (of_flat_dt_is_compatible(root, "fsl,P1010RDB-PB")) if (of_machine_is_compatible("fsl,P1010RDB-PB"))
return 1; return 1;
return 0; return 0;
} }
......
...@@ -555,9 +555,7 @@ machine_arch_initcall(p1022_ds, swiotlb_setup_bus_notifier); ...@@ -555,9 +555,7 @@ machine_arch_initcall(p1022_ds, swiotlb_setup_bus_notifier);
*/ */
static int __init p1022_ds_probe(void) static int __init p1022_ds_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,p1022ds");
return of_flat_dt_is_compatible(root, "fsl,p1022ds");
} }
define_machine(p1022_ds) { define_machine(p1022_ds) {
......
...@@ -135,9 +135,7 @@ machine_arch_initcall(p1022_rdk, swiotlb_setup_bus_notifier); ...@@ -135,9 +135,7 @@ machine_arch_initcall(p1022_rdk, swiotlb_setup_bus_notifier);
*/ */
static int __init p1022_rdk_probe(void) static int __init p1022_rdk_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,p1022rdk");
return of_flat_dt_is_compatible(root, "fsl,p1022rdk");
} }
define_machine(p1022_rdk) { define_machine(p1022_rdk) {
......
...@@ -100,9 +100,7 @@ static void __init mpc85xx_rdb_pic_init(void) ...@@ -100,9 +100,7 @@ static void __init mpc85xx_rdb_pic_init(void)
static int __init p1023_rdb_probe(void) static int __init p1023_rdb_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,P1023RDB");
return of_flat_dt_is_compatible(root, "fsl,P1023RDB");
} }
......
...@@ -81,9 +81,7 @@ machine_device_initcall(ppa8548, declare_of_platform_devices); ...@@ -81,9 +81,7 @@ machine_device_initcall(ppa8548, declare_of_platform_devices);
*/ */
static int __init ppa8548_probe(void) static int __init ppa8548_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("ppa8548");
return of_flat_dt_is_compatible(root, "ppa8548");
} }
define_machine(ppa8548) { define_machine(ppa8548) {
......
...@@ -62,9 +62,7 @@ static void __init qemu_e500_setup_arch(void) ...@@ -62,9 +62,7 @@ static void __init qemu_e500_setup_arch(void)
*/ */
static int __init qemu_e500_probe(void) static int __init qemu_e500_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return !!of_machine_is_compatible("fsl,qemu-e500");
return !!of_flat_dt_is_compatible(root, "fsl,qemu-e500");
} }
machine_arch_initcall(qemu_e500, mpc85xx_common_publish_devices); machine_arch_initcall(qemu_e500, mpc85xx_common_publish_devices);
......
...@@ -120,9 +120,7 @@ machine_arch_initcall(sbc8548, mpc85xx_common_publish_devices); ...@@ -120,9 +120,7 @@ machine_arch_initcall(sbc8548, mpc85xx_common_publish_devices);
*/ */
static int __init sbc8548_probe(void) static int __init sbc8548_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("SBC8548");
return of_flat_dt_is_compatible(root, "SBC8548");
} }
define_machine(sbc8548) { define_machine(sbc8548) {
......
...@@ -79,9 +79,7 @@ machine_arch_initcall(socrates, mpc85xx_common_publish_devices); ...@@ -79,9 +79,7 @@ machine_arch_initcall(socrates, mpc85xx_common_publish_devices);
*/ */
static int __init socrates_probe(void) static int __init socrates_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (of_machine_is_compatible("abb,socrates"))
if (of_flat_dt_is_compatible(root, "abb,socrates"))
return 1; return 1;
return 0; return 0;
......
...@@ -93,9 +93,7 @@ machine_arch_initcall(stx_gp3, mpc85xx_common_publish_devices); ...@@ -93,9 +93,7 @@ machine_arch_initcall(stx_gp3, mpc85xx_common_publish_devices);
*/ */
static int __init stx_gp3_probe(void) static int __init stx_gp3_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("stx,gp3-8560");
return of_flat_dt_is_compatible(root, "stx,gp3-8560");
} }
define_machine(stx_gp3) { define_machine(stx_gp3) {
......
...@@ -122,7 +122,7 @@ static const char * const board[] __initconst = { ...@@ -122,7 +122,7 @@ static const char * const board[] __initconst = {
*/ */
static int __init tqm85xx_probe(void) static int __init tqm85xx_probe(void)
{ {
return of_flat_dt_match(of_get_flat_dt_root(), board); return of_device_compatible_match(of_root, board);
} }
define_machine(tqm85xx) { define_machine(tqm85xx) {
......
...@@ -128,9 +128,7 @@ machine_arch_initcall(twr_p1025, mpc85xx_common_publish_devices); ...@@ -128,9 +128,7 @@ machine_arch_initcall(twr_p1025, mpc85xx_common_publish_devices);
static int __init twr_p1025_probe(void) static int __init twr_p1025_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,TWR-P1025");
return of_flat_dt_is_compatible(root, "fsl,TWR-P1025");
} }
define_machine(twr_p1025) { define_machine(twr_p1025) {
......
...@@ -144,23 +144,17 @@ machine_arch_initcall(xes_mpc8540, mpc85xx_common_publish_devices); ...@@ -144,23 +144,17 @@ machine_arch_initcall(xes_mpc8540, mpc85xx_common_publish_devices);
*/ */
static int __init xes_mpc8572_probe(void) static int __init xes_mpc8572_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("xes,MPC8572");
return of_flat_dt_is_compatible(root, "xes,MPC8572");
} }
static int __init xes_mpc8548_probe(void) static int __init xes_mpc8548_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("xes,MPC8548");
return of_flat_dt_is_compatible(root, "xes,MPC8548");
} }
static int __init xes_mpc8540_probe(void) static int __init xes_mpc8540_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("xes,MPC8540");
return of_flat_dt_is_compatible(root, "xes,MPC8540");
} }
define_machine(xes_mpc8572) { define_machine(xes_mpc8572) {
......
...@@ -189,9 +189,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB, ...@@ -189,9 +189,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB,
*/ */
static int __init gef_ppc9a_probe(void) static int __init gef_ppc9a_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (of_machine_is_compatible("gef,ppc9a"))
if (of_flat_dt_is_compatible(root, "gef,ppc9a"))
return 1; return 1;
return 0; return 0;
......
...@@ -176,9 +176,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB, ...@@ -176,9 +176,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB,
*/ */
static int __init gef_sbc310_probe(void) static int __init gef_sbc310_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (of_machine_is_compatible("gef,sbc310"))
if (of_flat_dt_is_compatible(root, "gef,sbc310"))
return 1; return 1;
return 0; return 0;
......
...@@ -166,9 +166,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB, ...@@ -166,9 +166,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB,
*/ */
static int __init gef_sbc610_probe(void) static int __init gef_sbc610_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (of_machine_is_compatible("gef,sbc610"))
if (of_flat_dt_is_compatible(root, "gef,sbc610"))
return 1; return 1;
return 0; return 0;
......
...@@ -319,9 +319,7 @@ static void __init mpc86xx_hpcd_setup_arch(void) ...@@ -319,9 +319,7 @@ static void __init mpc86xx_hpcd_setup_arch(void)
*/ */
static int __init mpc86xx_hpcd_probe(void) static int __init mpc86xx_hpcd_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (of_machine_is_compatible("fsl,MPC8610HPCD"))
if (of_flat_dt_is_compatible(root, "fsl,MPC8610HPCD"))
return 1; /* Looks good */ return 1; /* Looks good */
return 0; return 0;
......
...@@ -96,13 +96,11 @@ mpc86xx_hpcn_show_cpuinfo(struct seq_file *m) ...@@ -96,13 +96,11 @@ mpc86xx_hpcn_show_cpuinfo(struct seq_file *m)
*/ */
static int __init mpc86xx_hpcn_probe(void) static int __init mpc86xx_hpcn_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (of_machine_is_compatible("fsl,mpc8641hpcn"))
if (of_flat_dt_is_compatible(root, "fsl,mpc8641hpcn"))
return 1; /* Looks good */ return 1; /* Looks good */
/* Be nice and don't give silent boot death. Delete this in 2.6.27 */ /* Be nice and don't give silent boot death. Delete this in 2.6.27 */
if (of_flat_dt_is_compatible(root, "mpc86xx")) { if (of_machine_is_compatible("mpc86xx")) {
pr_warning("WARNING: your dts/dtb is old. You must update before the next kernel release\n"); pr_warning("WARNING: your dts/dtb is old. You must update before the next kernel release\n");
return 1; return 1;
} }
......
...@@ -67,9 +67,7 @@ sbc8641_show_cpuinfo(struct seq_file *m) ...@@ -67,9 +67,7 @@ sbc8641_show_cpuinfo(struct seq_file *m)
*/ */
static int __init sbc8641_probe(void) static int __init sbc8641_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (of_machine_is_compatible("wind,sbc8641"))
if (of_flat_dt_is_compatible(root, "wind,sbc8641"))
return 1; /* Looks good */ return 1; /* Looks good */
return 0; return 0;
......
...@@ -88,8 +88,7 @@ static void __init adder875_setup(void) ...@@ -88,8 +88,7 @@ static void __init adder875_setup(void)
static int __init adder875_probe(void) static int __init adder875_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("analogue-and-micro,adder875");
return of_flat_dt_is_compatible(root, "analogue-and-micro,adder875");
} }
static const struct of_device_id of_bus_ids[] __initconst = { static const struct of_device_id of_bus_ids[] __initconst = {
......
...@@ -143,8 +143,7 @@ static void __init ep88xc_setup_arch(void) ...@@ -143,8 +143,7 @@ static void __init ep88xc_setup_arch(void)
static int __init ep88xc_probe(void) static int __init ep88xc_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,ep88xc");
return of_flat_dt_is_compatible(root, "fsl,ep88xc");
} }
static const struct of_device_id of_bus_ids[] __initconst = { static const struct of_device_id of_bus_ids[] __initconst = {
......
...@@ -118,8 +118,7 @@ static void __init mpc86xads_setup_arch(void) ...@@ -118,8 +118,7 @@ static void __init mpc86xads_setup_arch(void)
static int __init mpc86xads_probe(void) static int __init mpc86xads_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,mpc866ads");
return of_flat_dt_is_compatible(root, "fsl,mpc866ads");
} }
static const struct of_device_id of_bus_ids[] __initconst = { static const struct of_device_id of_bus_ids[] __initconst = {
......
...@@ -193,8 +193,7 @@ static void __init mpc885ads_setup_arch(void) ...@@ -193,8 +193,7 @@ static void __init mpc885ads_setup_arch(void)
static int __init mpc885ads_probe(void) static int __init mpc885ads_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("fsl,mpc885ads");
return of_flat_dt_is_compatible(root, "fsl,mpc885ads");
} }
static const struct of_device_id of_bus_ids[] __initconst = { static const struct of_device_id of_bus_ids[] __initconst = {
......
...@@ -119,9 +119,7 @@ static void __init tqm8xx_setup_arch(void) ...@@ -119,9 +119,7 @@ static void __init tqm8xx_setup_arch(void)
static int __init tqm8xx_probe(void) static int __init tqm8xx_probe(void)
{ {
unsigned long node = of_get_flat_dt_root(); return of_machine_is_compatible("tqc,tqm8xx");
return of_flat_dt_is_compatible(node, "tqc,tqm8xx");
} }
static const struct of_device_id of_bus_ids[] __initconst = { static const struct of_device_id of_bus_ids[] __initconst = {
......
...@@ -143,9 +143,7 @@ void __noreturn amigaone_restart(char *cmd) ...@@ -143,9 +143,7 @@ void __noreturn amigaone_restart(char *cmd)
static int __init amigaone_probe(void) static int __init amigaone_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (of_machine_is_compatible("eyetech,amigaone")) {
if (of_flat_dt_is_compatible(root, "eyetech,amigaone")) {
/* /*
* Coherent memory access cause complete system lockup! Thus * Coherent memory access cause complete system lockup! Thus
* disable this CPU feature, even if the CPU needs it. * disable this CPU feature, even if the CPU needs it.
......
...@@ -123,9 +123,7 @@ void c2k_show_cpuinfo(struct seq_file *m) ...@@ -123,9 +123,7 @@ void c2k_show_cpuinfo(struct seq_file *m)
*/ */
static int __init c2k_probe(void) static int __init c2k_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (!of_machine_is_compatible("GEFanuc,C2K"))
if (!of_flat_dt_is_compatible(root, "GEFanuc,C2K"))
return 0; return 0;
printk(KERN_INFO "Detected a GEFanuc C2K board\n"); printk(KERN_INFO "Detected a GEFanuc C2K board\n");
......
...@@ -61,10 +61,7 @@ static void __init gamecube_init_early(void) ...@@ -61,10 +61,7 @@ static void __init gamecube_init_early(void)
static int __init gamecube_probe(void) static int __init gamecube_probe(void)
{ {
unsigned long dt_root; if (!of_machine_is_compatible("nintendo,gamecube"))
dt_root = of_get_flat_dt_root();
if (!of_flat_dt_is_compatible(dt_root, "nintendo,gamecube"))
return 0; return 0;
pm_power_off = gamecube_power_off; pm_power_off = gamecube_power_off;
......
...@@ -250,9 +250,7 @@ void holly_halt(void) ...@@ -250,9 +250,7 @@ void holly_halt(void)
*/ */
static int __init holly_probe(void) static int __init holly_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (!of_machine_is_compatible("ibm,holly"))
if (!of_flat_dt_is_compatible(root, "ibm,holly"))
return 0; return 0;
return 1; return 1;
} }
......
...@@ -141,11 +141,7 @@ static void linkstation_show_cpuinfo(struct seq_file *m) ...@@ -141,11 +141,7 @@ static void linkstation_show_cpuinfo(struct seq_file *m)
static int __init linkstation_probe(void) static int __init linkstation_probe(void)
{ {
unsigned long root; if (!of_machine_is_compatible("linkstation"))
root = of_get_flat_dt_root();
if (!of_flat_dt_is_compatible(root, "linkstation"))
return 0; return 0;
pm_power_off = linkstation_power_off; pm_power_off = linkstation_power_off;
......
...@@ -161,9 +161,7 @@ static void __noreturn mpc7448_hpc2_restart(char *cmd) ...@@ -161,9 +161,7 @@ static void __noreturn mpc7448_hpc2_restart(char *cmd)
*/ */
static int __init mpc7448_hpc2_probe(void) static int __init mpc7448_hpc2_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); if (!of_machine_is_compatible("mpc74xx"))
if (!of_flat_dt_is_compatible(root, "mpc74xx"))
return 0; return 0;
return 1; return 1;
} }
......
...@@ -194,9 +194,7 @@ static void __noreturn mvme5100_restart(char *cmd) ...@@ -194,9 +194,7 @@ static void __noreturn mvme5100_restart(char *cmd)
*/ */
static int __init mvme5100_probe(void) static int __init mvme5100_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("MVME5100");
return of_flat_dt_is_compatible(root, "MVME5100");
} }
static int __init probe_of_platform_devices(void) static int __init probe_of_platform_devices(void)
......
...@@ -109,9 +109,7 @@ static void __noreturn storcenter_restart(char *cmd) ...@@ -109,9 +109,7 @@ static void __noreturn storcenter_restart(char *cmd)
static int __init storcenter_probe(void) static int __init storcenter_probe(void)
{ {
unsigned long root = of_get_flat_dt_root(); return of_machine_is_compatible("iomega,storcenter");
return of_flat_dt_is_compatible(root, "iomega,storcenter");
} }
define_machine(storcenter){ define_machine(storcenter){
......
...@@ -205,10 +205,7 @@ static void __init wii_pic_probe(void) ...@@ -205,10 +205,7 @@ static void __init wii_pic_probe(void)
static int __init wii_probe(void) static int __init wii_probe(void)
{ {
unsigned long dt_root; if (!of_machine_is_compatible("nintendo,wii"))
dt_root = of_get_flat_dt_root();
if (!of_flat_dt_is_compatible(dt_root, "nintendo,wii"))
return 0; return 0;
pm_power_off = wii_power_off; pm_power_off = wii_power_off;
......
...@@ -590,17 +590,9 @@ console_initcall(check_pmac_serial_console); ...@@ -590,17 +590,9 @@ console_initcall(check_pmac_serial_console);
*/ */
static int __init pmac_probe(void) static int __init pmac_probe(void)
{ {
#ifdef CONFIG_PPC32
unsigned long root = of_get_flat_dt_root();
if (!of_flat_dt_is_compatible(root, "Power Macintosh") &&
!of_flat_dt_is_compatible(root, "MacRISC"))
return 0;
#else
if (!of_machine_is_compatible("Power Macintosh") && if (!of_machine_is_compatible("Power Macintosh") &&
!of_machine_is_compatible("MacRISC")) !of_machine_is_compatible("MacRISC"))
return 0; return 0;
#endif
#ifdef CONFIG_PPC32 #ifdef CONFIG_PPC32
/* isa_io_base gets set in pmac_pci_init */ /* isa_io_base gets set in pmac_pci_init */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment