Commit f7738c07 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Herbert Xu
Browse files

crypto: nx - Simplify with scoped for each OF child loop



Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.

Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent e1dc530d
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -908,7 +908,6 @@ static int __init nx_powernv_probe_vas(struct device_node *pn)
{
	int chip_id, vasid, ret = 0;
	int ct_842 = 0, ct_gzip = 0;
	struct device_node *dn;

	chip_id = of_get_ibm_chip_id(pn);
	if (chip_id < 0) {
@@ -922,7 +921,7 @@ static int __init nx_powernv_probe_vas(struct device_node *pn)
		return -EINVAL;
	}

	for_each_child_of_node(pn, dn) {
	for_each_child_of_node_scoped(pn, dn) {
		ret = find_nx_device_tree(dn, chip_id, vasid, NX_CT_842,
					"ibm,p9-nx-842", &ct_842);

@@ -930,11 +929,9 @@ static int __init nx_powernv_probe_vas(struct device_node *pn)
			ret = find_nx_device_tree(dn, chip_id, vasid,
				NX_CT_GZIP, "ibm,p9-nx-gzip", &ct_gzip);

		if (ret) {
			of_node_put(dn);
		if (ret)
			return ret;
	}
	}

	if (!ct_842 || !ct_gzip) {
		pr_err("NX FIFO nodes are missing\n");