Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc9f75ef authored by Wei Yongjun's avatar Wei Yongjun Committed by Michael Ellerman
Browse files

cxl: Use for_each_compatible_node() macro



Use for_each_compatible_node() macro instead of open coding it.

Generated by Coccinelle.

Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: default avatarAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: default avatarIan Munsie <imunsie@au1.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 24af8c5a
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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++;