File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ struct pci_host_bridge;
2222struct machdep_calls {
2323 const char * name ;
2424 const char * compatible ;
25+ const char * const * compatibles ;
2526#ifdef CONFIG_PPC64
2627#ifdef CONFIG_PM
2728 void (* iommu_restore )(void );
Original file line number Diff line number Diff line change @@ -640,6 +640,8 @@ static __init void probe_machine(void)
640640 DBG (" %s ...\n" , machine_id -> name );
641641 if (machine_id -> compatible && !of_machine_is_compatible (machine_id -> compatible ))
642642 continue ;
643+ if (machine_id -> compatibles && !of_machine_compatible_match (machine_id -> compatibles ))
644+ continue ;
643645 memcpy (& ppc_md , machine_id , sizeof (struct machdep_calls ));
644646 if (ppc_md .probe && !ppc_md .probe ())
645647 continue ;
Original file line number Diff line number Diff line change @@ -59,16 +59,13 @@ static const char * const board[] __initconst = {
5959
6060static int __init ppc40x_probe (void )
6161{
62- if (of_device_compatible_match (of_root , board )) {
63- pci_set_flags (PCI_REASSIGN_ALL_RSRC );
64- return 1 ;
65- }
66-
67- return 0 ;
62+ pci_set_flags (PCI_REASSIGN_ALL_RSRC );
63+ return 1 ;
6864}
6965
7066define_machine (ppc40x_simple ) {
7167 .name = "PowerPC 40x Platform" ,
68+ .compatibles = board ,
7269 .probe = ppc40x_probe ,
7370 .progress = udbg_progress ,
7471 .init_IRQ = uic_init_tree ,
Original file line number Diff line number Diff line change @@ -32,16 +32,14 @@ static const char * const board[] __initconst = {
3232 */
3333static int __init mpc512x_generic_probe (void )
3434{
35- if (!of_device_compatible_match (of_root , board ))
36- return 0 ;
37-
3835 mpc512x_init_early ();
3936
4037 return 1 ;
4138}
4239
4340define_machine (mpc512x_generic ) {
4441 .name = "MPC512x generic" ,
42+ .compatibles = board ,
4543 .probe = mpc512x_generic_probe ,
4644 .init = mpc512x_init ,
4745 .setup_arch = mpc512x_setup_arch ,
Original file line number Diff line number Diff line change @@ -172,17 +172,9 @@ static const char * const board[] __initconst = {
172172 NULL ,
173173};
174174
175- /*
176- * Called very early, MMU is off, device-tree isn't unflattened
177- */
178- static int __init lite5200_probe (void )
179- {
180- return of_device_compatible_match (of_root , board );
181- }
182-
183175define_machine (lite5200 ) {
184176 .name = "lite5200" ,
185- .probe = lite5200_probe ,
177+ .compatibles = board ,
186178 .setup_arch = lite5200_setup_arch ,
187179 .discover_phbs = mpc52xx_setup_pci ,
188180 .init = mpc52xx_declare_of_platform_devices ,
Original file line number Diff line number Diff line change @@ -59,17 +59,9 @@ static const char *board[] __initdata = {
5959 NULL
6060};
6161
62- /*
63- * Called very early, MMU is off, device-tree isn't unflattened
64- */
65- static int __init mpc5200_simple_probe (void )
66- {
67- return of_device_compatible_match (of_root , board );
68- }
69-
7062define_machine (mpc5200_simple_platform ) {
7163 .name = "mpc5200-simple-platform" ,
72- .probe = mpc5200_simple_probe ,
64+ .compatibles = board ,
7365 .setup_arch = mpc5200_simple_setup_arch ,
7466 .discover_phbs = mpc52xx_setup_pci ,
7567 .init = mpc52xx_declare_of_platform_devices ,
Original file line number Diff line number Diff line change @@ -34,19 +34,11 @@ static const char *board[] __initdata = {
3434 NULL
3535};
3636
37- /*
38- * Called very early, MMU is off, device-tree isn't unflattened
39- */
40- static int __init mpc830x_rdb_probe (void )
41- {
42- return of_device_compatible_match (of_root , board );
43- }
44-
4537machine_device_initcall (mpc830x_rdb , mpc83xx_declare_of_platform_devices );
4638
4739define_machine (mpc830x_rdb ) {
4840 .name = "MPC830x RDB" ,
49- .probe = mpc830x_rdb_probe ,
41+ .compatibles = board ,
5042 .setup_arch = mpc830x_rdb_setup_arch ,
5143 .discover_phbs = mpc83xx_setup_pci ,
5244 .init_IRQ = mpc83xx_ipic_init_IRQ ,
Original file line number Diff line number Diff line change @@ -34,19 +34,11 @@ static const char *board[] __initdata = {
3434 NULL
3535};
3636
37- /*
38- * Called very early, MMU is off, device-tree isn't unflattened
39- */
40- static int __init mpc831x_rdb_probe (void )
41- {
42- return of_device_compatible_match (of_root , board );
43- }
44-
4537machine_device_initcall (mpc831x_rdb , mpc83xx_declare_of_platform_devices );
4638
4739define_machine (mpc831x_rdb ) {
4840 .name = "MPC831x RDB" ,
49- .probe = mpc831x_rdb_probe ,
41+ .compatibles = board ,
5042 .setup_arch = mpc831x_rdb_setup_arch ,
5143 .discover_phbs = mpc83xx_setup_pci ,
5244 .init_IRQ = mpc83xx_ipic_init_IRQ ,
Original file line number Diff line number Diff line change @@ -61,17 +61,9 @@ static const char * const board[] __initconst = {
6161 NULL
6262};
6363
64- /*
65- * Called very early, MMU is off, device-tree isn't unflattened
66- */
67- static int __init mpc837x_rdb_probe (void )
68- {
69- return of_device_compatible_match (of_root , board );
70- }
71-
7264define_machine (mpc837x_rdb ) {
7365 .name = "MPC837x RDB/WLAN" ,
74- .probe = mpc837x_rdb_probe ,
66+ .compatibles = board ,
7567 .setup_arch = mpc837x_rdb_setup_arch ,
7668 .discover_phbs = mpc83xx_setup_pci ,
7769 .init_IRQ = mpc83xx_ipic_init_IRQ ,
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ static int __init corenet_generic_probe(void)
149149 extern struct smp_ops_t smp_85xx_ops ;
150150#endif
151151
152- if (of_device_compatible_match ( of_root , boards ))
152+ if (of_machine_compatible_match ( boards ))
153153 return 1 ;
154154
155155 /* Check if we're running under the Freescale hypervisor */
You can’t perform that action at this time.
0 commit comments