MIPS: Create a helper function for DT setup

A couple of platforms register two buses and call of_platform_populate().
Move this into a common function to reduce duplication.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Cc: f.fainelli@gmail.com
Cc: mbizon@freebox.fr
Cc: jogo@openwrt.org
Cc: jfraser@broadcom.com
Cc: linux-mips@linux-mips.org
Cc: devicetree@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8167/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
Kevin Cernekee
2014-10-20 21:28:02 -07:00
committed by Ralf Baechle
parent 68e6a78373
commit 84988c0681
4 changed files with 22 additions and 22 deletions

View File

@@ -97,16 +97,7 @@ void __init prom_init(void)
int __init plat_of_setup(void)
{
static struct of_device_id of_ids[3];
if (!of_have_populated_dt())
panic("device tree not present");
strlcpy(of_ids[0].compatible, soc_info.compatible,
sizeof(of_ids[0].compatible));
strncpy(of_ids[1].compatible, "simple-bus",
sizeof(of_ids[1].compatible));
return of_platform_populate(NULL, of_ids, NULL, NULL);
return __dt_register_buses(soc_info.compatible, "simple-bus");
}
arch_initcall(plat_of_setup);