diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2016-07-12 07:30:11 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-07-14 06:26:25 -0400 |
commit | fc9f75ef2fdf46fc859b991dbf473a583edfb0e2 (patch) | |
tree | da297b8c2bcaaf36db1bf1475422c1227f912052 /drivers/misc/cxl/base.c | |
parent | 24af8c5a52a70bbfd275f59836feadd9b9ebc83b (diff) |
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>
Diffstat (limited to 'drivers/misc/cxl/base.c')
-rw-r--r-- | drivers/misc/cxl/base.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/misc/cxl/base.c b/drivers/misc/cxl/base.c index e6f49aca0035..2330980bdde2 100644 --- a/drivers/misc/cxl/base.c +++ b/drivers/misc/cxl/base.c | |||
@@ -95,7 +95,7 @@ EXPORT_SYMBOL_GPL(cxl_update_properties); | |||
95 | 95 | ||
96 | static int __init cxl_base_init(void) | 96 | static int __init cxl_base_init(void) |
97 | { | 97 | { |
98 | struct device_node *np = NULL; | 98 | struct device_node *np; |
99 | struct platform_device *dev; | 99 | struct platform_device *dev; |
100 | int count = 0; | 100 | int count = 0; |
101 | 101 | ||
@@ -105,8 +105,7 @@ static int __init cxl_base_init(void) | |||
105 | if (cpu_has_feature(CPU_FTR_HVMODE)) | 105 | if (cpu_has_feature(CPU_FTR_HVMODE)) |
106 | return 0; | 106 | return 0; |
107 | 107 | ||
108 | while ((np = of_find_compatible_node(np, NULL, | 108 | for_each_compatible_node(np, NULL, "ibm,coherent-platform-facility") { |
109 | "ibm,coherent-platform-facility"))) { | ||
110 | dev = of_platform_device_create(np, NULL, NULL); | 109 | dev = of_platform_device_create(np, NULL, NULL); |
111 | if (dev) | 110 | if (dev) |
112 | count++; | 111 | count++; |