[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1468323011-1513-1-git-send-email-weiyj_lk@163.com>
Date: Tue, 12 Jul 2016 11:30:11 +0000
From: weiyj_lk@....com
To: Ian Munsie <imunsie@....ibm.com>,
Michael Neuling <mikey@...ling.org>
Cc: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: [PATCH -next] cxl: Use for_each_compatible_node() macro
From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
Use for_each_compatible_node() macro instead of open coding it.
Generated by Coccinelle.
Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
---
drivers/misc/cxl/base.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/misc/cxl/base.c b/drivers/misc/cxl/base.c
index e6f49ac..2330980 100644
--- a/drivers/misc/cxl/base.c
+++ b/drivers/misc/cxl/base.c
@@ -95,7 +95,7 @@ EXPORT_SYMBOL_GPL(cxl_update_properties);
static int __init cxl_base_init(void)
{
- struct device_node *np = NULL;
+ struct device_node *np;
struct platform_device *dev;
int count = 0;
@@ -105,8 +105,7 @@ static int __init cxl_base_init(void)
if (cpu_has_feature(CPU_FTR_HVMODE))
return 0;
- while ((np = of_find_compatible_node(np, NULL,
- "ibm,coherent-platform-facility"))) {
+ for_each_compatible_node(np, NULL, "ibm,coherent-platform-facility") {
dev = of_platform_device_create(np, NULL, NULL);
if (dev)
count++;
Powered by blists - more mailing lists