提交 48c06154 编写于 作者: J Jeremy Kerr 提交者: Michael Ellerman

powerpc/powernv: Merge common platform device initialisation

opal_ipmi_init and opal_flash_init are equivalent, except for the
compatbile string. Merge these two into a common opal_pdev_init
function.
Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 18725226
...@@ -600,21 +600,13 @@ static void __init opal_dump_region_init(void) ...@@ -600,21 +600,13 @@ static void __init opal_dump_region_init(void)
"rc = %d\n", rc); "rc = %d\n", rc);
} }
static void opal_flash_init(struct device_node *opal_node) static void opal_pdev_init(struct device_node *opal_node,
const char *compatible)
{ {
struct device_node *np; struct device_node *np;
for_each_child_of_node(opal_node, np) for_each_child_of_node(opal_node, np)
if (of_device_is_compatible(np, "ibm,opal-flash")) if (of_device_is_compatible(np, compatible))
of_platform_device_create(np, NULL, NULL);
}
static void opal_ipmi_init(struct device_node *opal_node)
{
struct device_node *np;
for_each_child_of_node(opal_node, np)
if (of_device_is_compatible(np, "ibm,opal-ipmi"))
of_platform_device_create(np, NULL, NULL); of_platform_device_create(np, NULL, NULL);
} }
...@@ -717,10 +709,9 @@ static int __init opal_init(void) ...@@ -717,10 +709,9 @@ static int __init opal_init(void)
opal_msglog_init(); opal_msglog_init();
} }
/* Initialize OPAL IPMI backend */ /* Initialize platform devices: IPMI backend & flash interface */
opal_ipmi_init(opal_node); opal_pdev_init(opal_node, "ibm,opal-ipmi");
opal_pdev_init(opal_node, "ibm,opal-flash");
opal_flash_init(opal_node);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册