提交 fc9f75ef 编写于 作者: W Wei Yongjun 提交者: Michael Ellerman

cxl: Use for_each_compatible_node() macro

Use for_each_compatible_node() macro instead of open coding it.

Generated by Coccinelle.
Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: NAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: NIan Munsie <imunsie@au1.ibm.com>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 24af8c5a
...@@ -95,7 +95,7 @@ EXPORT_SYMBOL_GPL(cxl_update_properties); ...@@ -95,7 +95,7 @@ EXPORT_SYMBOL_GPL(cxl_update_properties);
static int __init cxl_base_init(void) static int __init cxl_base_init(void)
{ {
struct device_node *np = NULL; struct device_node *np;
struct platform_device *dev; struct platform_device *dev;
int count = 0; int count = 0;
...@@ -105,8 +105,7 @@ static int __init cxl_base_init(void) ...@@ -105,8 +105,7 @@ static int __init cxl_base_init(void)
if (cpu_has_feature(CPU_FTR_HVMODE)) if (cpu_has_feature(CPU_FTR_HVMODE))
return 0; return 0;
while ((np = of_find_compatible_node(np, NULL, for_each_compatible_node(np, NULL, "ibm,coherent-platform-facility") {
"ibm,coherent-platform-facility"))) {
dev = of_platform_device_create(np, NULL, NULL); dev = of_platform_device_create(np, NULL, NULL);
if (dev) if (dev)
count++; count++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册