Message ID | 1311065631-3429-11-git-send-email-dbaryshkov@gmail.com (mailing list archive) |
---|---|
State | Rejected |
Delegated to: | Kumar Gala |
Headers | show |
On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote: > p1020_rdb and p2020_rdb machine entries bear no in-kernel differencies > other than dt compatible strings. Merge them into single machine entry > named mpc85xx_rdb > > Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> > --- > arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 40 ++++++---------------------- > 1 files changed, 9 insertions(+), 31 deletions(-) > > diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c > index 088f30b..7a3a37b 100644 > --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c > +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c > @@ -120,47 +120,25 @@ static int __init mpc85xxrdb_publish_devices(void) > { > return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL); > } > -machine_device_initcall(p2020_rdb, mpc85xxrdb_publish_devices); > -machine_device_initcall(p1020_rdb, mpc85xxrdb_publish_devices); > +machine_device_initcall(mpc85xx_rdb, mpc85xxrdb_publish_devices); > > /* > * Called very early, device-tree isn't unflattened > */ > -static int __init p2020_rdb_probe(void) > +static int __init mpc85xx_rdb_probe(void) > { > unsigned long root = of_get_flat_dt_root(); > > - if (of_flat_dt_is_compatible(root, "fsl,P2020RDB")) > + if (of_flat_dt_is_compatible(root, "fsl,P1020RDB") || > + of_flat_dt_is_compatible(root, "fsl,P2020RDB")) { > return 1; > - return 0; > + } else > + return 0; > } > > -static int __init p1020_rdb_probe(void) > -{ > - unsigned long root = of_get_flat_dt_root(); > - > - if (of_flat_dt_is_compatible(root, "fsl,P1020RDB")) > - return 1; > - return 0; > -} > - > -define_machine(p2020_rdb) { > - .name = "P2020 RDB", > - .probe = p2020_rdb_probe, > - .setup_arch = mpc85xx_rdb_setup_arch, > - .init_IRQ = mpc85xx_rdb_pic_init, > -#ifdef CONFIG_PCI > - .pcibios_fixup_bus = fsl_pcibios_fixup_bus, > -#endif > - .get_irq = mpic_get_irq, > - .restart = fsl_rstcr_restart, > - .calibrate_decr = generic_calibrate_decr, > - .progress = udbg_progress, > -}; > - > -define_machine(p1020_rdb) { > - .name = "P1020 RDB", > - .probe = p1020_rdb_probe, > +define_machine(mpc85xx_rdb) { > + .name = "MPC85xx RDB", breaking 'name' this way isn't acceptable. > + .probe = mpc85xx_rdb_probe, > .setup_arch = mpc85xx_rdb_setup_arch, > .init_IRQ = mpc85xx_rdb_pic_init, > #ifdef CONFIG_PCI > -- > 1.7.2.5
On 7/19/11, Kumar Gala <galak@kernel.crashing.org> wrote: > > On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote: > >> p1020_rdb and p2020_rdb machine entries bear no in-kernel differencies >> other than dt compatible strings. Merge them into single machine entry >> named mpc85xx_rdb >> >> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> >> --- >> arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 40 >> ++++++---------------------- >> 1 files changed, 9 insertions(+), 31 deletions(-) >> >> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c >> b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c >> index 088f30b..7a3a37b 100644 >> --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c >> +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c >> @@ -120,47 +120,25 @@ static int __init mpc85xxrdb_publish_devices(void) >> { >> return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL); >> } >> -machine_device_initcall(p2020_rdb, mpc85xxrdb_publish_devices); >> -machine_device_initcall(p1020_rdb, mpc85xxrdb_publish_devices); >> +machine_device_initcall(mpc85xx_rdb, mpc85xxrdb_publish_devices); >> >> /* >> * Called very early, device-tree isn't unflattened >> */ >> -static int __init p2020_rdb_probe(void) >> +static int __init mpc85xx_rdb_probe(void) >> { >> unsigned long root = of_get_flat_dt_root(); >> >> - if (of_flat_dt_is_compatible(root, "fsl,P2020RDB")) >> + if (of_flat_dt_is_compatible(root, "fsl,P1020RDB") || >> + of_flat_dt_is_compatible(root, "fsl,P2020RDB")) { >> return 1; >> - return 0; >> + } else >> + return 0; >> } >> >> -static int __init p1020_rdb_probe(void) >> -{ >> - unsigned long root = of_get_flat_dt_root(); >> - >> - if (of_flat_dt_is_compatible(root, "fsl,P1020RDB")) >> - return 1; >> - return 0; >> -} >> - >> -define_machine(p2020_rdb) { >> - .name = "P2020 RDB", >> - .probe = p2020_rdb_probe, >> - .setup_arch = mpc85xx_rdb_setup_arch, >> - .init_IRQ = mpc85xx_rdb_pic_init, >> -#ifdef CONFIG_PCI >> - .pcibios_fixup_bus = fsl_pcibios_fixup_bus, >> -#endif >> - .get_irq = mpic_get_irq, >> - .restart = fsl_rstcr_restart, >> - .calibrate_decr = generic_calibrate_decr, >> - .progress = udbg_progress, >> -}; >> - >> -define_machine(p1020_rdb) { >> - .name = "P1020 RDB", >> - .probe = p1020_rdb_probe, >> +define_machine(mpc85xx_rdb) { >> + .name = "MPC85xx RDB", > > breaking 'name' this way isn't acceptable. What would be suitable from your point of view? Does "Px020 RDB" look good? Or something like it? > >> + .probe = mpc85xx_rdb_probe, >> .setup_arch = mpc85xx_rdb_setup_arch, >> .init_IRQ = mpc85xx_rdb_pic_init, >> #ifdef CONFIG_PCI >> -- >> 1.7.2.5 > >
On 7/19/11, Kumar Gala <galak@kernel.crashing.org> wrote: > > On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote: > >> p1020_rdb and p2020_rdb machine entries bear no in-kernel differencies >> other than dt compatible strings. Merge them into single machine entry >> named mpc85xx_rdb >> >> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> >> --- >> arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 40 >> ++++++---------------------- >> 1 files changed, 9 insertions(+), 31 deletions(-) >> >> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c >> b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c >> index 088f30b..7a3a37b 100644 >> --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c >> +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c >> @@ -120,47 +120,25 @@ static int __init mpc85xxrdb_publish_devices(void) >> { >> return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL); >> } >> -machine_device_initcall(p2020_rdb, mpc85xxrdb_publish_devices); >> -machine_device_initcall(p1020_rdb, mpc85xxrdb_publish_devices); >> +machine_device_initcall(mpc85xx_rdb, mpc85xxrdb_publish_devices); >> >> /* >> * Called very early, device-tree isn't unflattened >> */ >> -static int __init p2020_rdb_probe(void) >> +static int __init mpc85xx_rdb_probe(void) >> { >> unsigned long root = of_get_flat_dt_root(); >> >> - if (of_flat_dt_is_compatible(root, "fsl,P2020RDB")) >> + if (of_flat_dt_is_compatible(root, "fsl,P1020RDB") || >> + of_flat_dt_is_compatible(root, "fsl,P2020RDB")) { >> return 1; >> - return 0; >> + } else >> + return 0; >> } >> >> -static int __init p1020_rdb_probe(void) >> -{ >> - unsigned long root = of_get_flat_dt_root(); >> - >> - if (of_flat_dt_is_compatible(root, "fsl,P1020RDB")) >> - return 1; >> - return 0; >> -} >> - >> -define_machine(p2020_rdb) { >> - .name = "P2020 RDB", >> - .probe = p2020_rdb_probe, >> - .setup_arch = mpc85xx_rdb_setup_arch, >> - .init_IRQ = mpc85xx_rdb_pic_init, >> -#ifdef CONFIG_PCI >> - .pcibios_fixup_bus = fsl_pcibios_fixup_bus, >> -#endif >> - .get_irq = mpic_get_irq, >> - .restart = fsl_rstcr_restart, >> - .calibrate_decr = generic_calibrate_decr, >> - .progress = udbg_progress, >> -}; >> - >> -define_machine(p1020_rdb) { >> - .name = "P1020 RDB", >> - .probe = p1020_rdb_probe, >> +define_machine(mpc85xx_rdb) { >> + .name = "MPC85xx RDB", > > breaking 'name' this way isn't acceptable. BTW: what is so special in p1010rdb, so it's not merged into this file, but exists as a separate .c file? > >> + .probe = mpc85xx_rdb_probe, >> .setup_arch = mpc85xx_rdb_setup_arch, >> .init_IRQ = mpc85xx_rdb_pic_init, >> #ifdef CONFIG_PCI >> -- >> 1.7.2.5 > >
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c index 088f30b..7a3a37b 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c @@ -120,47 +120,25 @@ static int __init mpc85xxrdb_publish_devices(void) { return of_platform_bus_probe(NULL, mpc85xxrdb_ids, NULL); } -machine_device_initcall(p2020_rdb, mpc85xxrdb_publish_devices); -machine_device_initcall(p1020_rdb, mpc85xxrdb_publish_devices); +machine_device_initcall(mpc85xx_rdb, mpc85xxrdb_publish_devices); /* * Called very early, device-tree isn't unflattened */ -static int __init p2020_rdb_probe(void) +static int __init mpc85xx_rdb_probe(void) { unsigned long root = of_get_flat_dt_root(); - if (of_flat_dt_is_compatible(root, "fsl,P2020RDB")) + if (of_flat_dt_is_compatible(root, "fsl,P1020RDB") || + of_flat_dt_is_compatible(root, "fsl,P2020RDB")) { return 1; - return 0; + } else + return 0; } -static int __init p1020_rdb_probe(void) -{ - unsigned long root = of_get_flat_dt_root(); - - if (of_flat_dt_is_compatible(root, "fsl,P1020RDB")) - return 1; - return 0; -} - -define_machine(p2020_rdb) { - .name = "P2020 RDB", - .probe = p2020_rdb_probe, - .setup_arch = mpc85xx_rdb_setup_arch, - .init_IRQ = mpc85xx_rdb_pic_init, -#ifdef CONFIG_PCI - .pcibios_fixup_bus = fsl_pcibios_fixup_bus, -#endif - .get_irq = mpic_get_irq, - .restart = fsl_rstcr_restart, - .calibrate_decr = generic_calibrate_decr, - .progress = udbg_progress, -}; - -define_machine(p1020_rdb) { - .name = "P1020 RDB", - .probe = p1020_rdb_probe, +define_machine(mpc85xx_rdb) { + .name = "MPC85xx RDB", + .probe = mpc85xx_rdb_probe, .setup_arch = mpc85xx_rdb_setup_arch, .init_IRQ = mpc85xx_rdb_pic_init, #ifdef CONFIG_PCI
p1020_rdb and p2020_rdb machine entries bear no in-kernel differencies other than dt compatible strings. Merge them into single machine entry named mpc85xx_rdb Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> --- arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 40 ++++++---------------------- 1 files changed, 9 insertions(+), 31 deletions(-)