Cleaned up the probing functionality to be more consistent across all 85xx
boards and actually check to see if we should be running on a given board.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
struct device_node *np;
static u8 *bcsr_regs = NULL;
struct device_node *np;
static u8 *bcsr_regs = NULL;
if (ppc_md.progress)
ppc_md.progress("mpc8568_mds_setup_arch()", 0);
if (ppc_md.progress)
ppc_md.progress("mpc8568_mds_setup_arch()", 0);
#ifdef CONFIG_QUICC_ENGINE
np = of_find_node_by_type(NULL, "qeic");
if (!np)
#ifdef CONFIG_QUICC_ENGINE
np = of_find_node_by_type(NULL, "qeic");
if (!np)
#endif /* CONFIG_QUICC_ENGINE */
}
#endif /* CONFIG_QUICC_ENGINE */
}
static int __init mpc8568_mds_probe(void)
{
static int __init mpc8568_mds_probe(void)
{
- char *model = of_get_flat_dt_prop(of_get_flat_dt_root(),
- "model", NULL);
- if (model == NULL)
- return 0;
- if (strcmp(model, "MPC8568EMDS"))
- return 0;
-
- DBG("MPC8568EMDS found\n");
+ unsigned long root = of_get_flat_dt_root();
+ return of_flat_dt_is_compatible(root, "MPC85xxMDS");
define_machine(mpc8568_mds) {
define_machine(mpc8568_mds) {
- .name = "MPC8568E MDS",
.probe = mpc8568_mds_probe,
.setup_arch = mpc8568_mds_setup_arch,
.init_IRQ = mpc8568_mds_pic_init,
.probe = mpc8568_mds_probe,
.setup_arch = mpc8568_mds_setup_arch,
.init_IRQ = mpc8568_mds_pic_init,
*/
static int __init mpc85xx_ads_probe(void)
{
*/
static int __init mpc85xx_ads_probe(void)
{
- /* We always match for now, eventually we should look at the flat
- dev tree to ensure this is the board we are suppose to run on
- */
- return 1;
+ unsigned long root = of_get_flat_dt_root();
+
+ return of_flat_dt_is_compatible(root, "MPC85xxADS");
}
define_machine(mpc85xx_ads) {
}
define_machine(mpc85xx_ads) {
*/
static int __init mpc85xx_cds_probe(void)
{
*/
static int __init mpc85xx_cds_probe(void)
{
- /* We always match for now, eventually we should look at
- * the flat dev tree to ensure this is the board we are
- * supposed to run on
- */
- return 1;
+ unsigned long root = of_get_flat_dt_root();
+
+ return of_flat_dt_is_compatible(root, "MPC85xxCDS");
}
define_machine(mpc85xx_cds) {
}
define_machine(mpc85xx_cds) {