We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c0e167 commit 7021a79Copy full SHA for 7021a79
drivers/mtd/nand/raw/arasan-nand-controller.c
@@ -1360,7 +1360,7 @@ static void anfc_chips_cleanup(struct arasan_nfc *nfc)
1360
1361
static int anfc_chips_init(struct arasan_nfc *nfc)
1362
{
1363
- struct device_node *np = nfc->dev->of_node, *nand_np;
+ struct device_node *np = nfc->dev->of_node;
1364
int nchips = of_get_child_count(np);
1365
int ret;
1366
@@ -1370,10 +1370,9 @@ static int anfc_chips_init(struct arasan_nfc *nfc)
1370
return -EINVAL;
1371
}
1372
1373
- for_each_child_of_node(np, nand_np) {
+ for_each_child_of_node_scoped(np, nand_np) {
1374
ret = anfc_chip_init(nfc, nand_np);
1375
if (ret) {
1376
- of_node_put(nand_np);
1377
anfc_chips_cleanup(nfc);
1378
break;
1379
0 commit comments