From: Wei Yongjun Date: Tue, 12 Jul 2016 11:30:11 +0000 (+0000) Subject: cxl: Use for_each_compatible_node() macro X-Git-Tag: v4.8-rc1~85^2~116 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc9f75ef2fdf46fc859b991dbf473a583edfb0e2;p=thirdparty%2Fkernel%2Flinux.git cxl: Use for_each_compatible_node() macro Use for_each_compatible_node() macro instead of open coding it. Generated by Coccinelle. Signed-off-by: Wei Yongjun Reviewed-by: Andrew Donnellan Acked-by: Ian Munsie Signed-off-by: Michael Ellerman --- diff --git a/drivers/misc/cxl/base.c b/drivers/misc/cxl/base.c index e6f49aca0035b..2330980bdde20 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++;