mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:24:45 +01:00
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: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
e1dc530d0c
commit
f7738c07b5
1 changed files with 2 additions and 5 deletions
|
|
@ -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,10 +929,8 @@ 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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue