Skip to content

Commit fc9f75e

Browse files
Wei Yongjunmpe
authored andcommitted
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 <yongjun_wei@trendmicro.com.cn> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Acked-by: Ian Munsie <imunsie@au1.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 24af8c5 commit fc9f75e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎drivers/misc/cxl/base.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ EXPORT_SYMBOL_GPL(cxl_update_properties);
9595

9696
static int __init cxl_base_init(void)
9797
{
98-
struct device_node *np = NULL;
98+
struct device_node *np;
9999
struct platform_device *dev;
100100
int count = 0;
101101

@@ -105,8 +105,7 @@ static int __init cxl_base_init(void)
105105
if (cpu_has_feature(CPU_FTR_HVMODE))
106106
return 0;
107107

108-
while ((np = of_find_compatible_node(np, NULL,
109-
"ibm,coherent-platform-facility"))) {
108+
for_each_compatible_node(np, NULL, "ibm,coherent-platform-facility") {
110109
dev = of_platform_device_create(np, NULL, NULL);
111110
if (dev)
112111
count++;

0 commit comments

Comments
 (0)