@@ -1449,7 +1449,7 @@ static int imx_gpcv2_probe(struct platform_device *pdev)
1449
1449
.max_register = SZ_4K ,
1450
1450
};
1451
1451
struct device * dev = & pdev -> dev ;
1452
- struct device_node * pgc_np , * np ;
1452
+ struct device_node * pgc_np ;
1453
1453
struct regmap * regmap ;
1454
1454
void __iomem * base ;
1455
1455
int ret ;
@@ -1471,7 +1471,7 @@ static int imx_gpcv2_probe(struct platform_device *pdev)
1471
1471
return ret ;
1472
1472
}
1473
1473
1474
- for_each_child_of_node (pgc_np , np ) {
1474
+ for_each_child_of_node_scoped (pgc_np , np ) {
1475
1475
struct platform_device * pd_pdev ;
1476
1476
struct imx_pgc_domain * domain ;
1477
1477
u32 domain_index ;
@@ -1482,7 +1482,6 @@ static int imx_gpcv2_probe(struct platform_device *pdev)
1482
1482
ret = of_property_read_u32 (np , "reg" , & domain_index );
1483
1483
if (ret ) {
1484
1484
dev_err (dev , "Failed to read 'reg' property\n" );
1485
- of_node_put (np );
1486
1485
return ret ;
1487
1486
}
1488
1487
@@ -1497,7 +1496,6 @@ static int imx_gpcv2_probe(struct platform_device *pdev)
1497
1496
domain_index );
1498
1497
if (!pd_pdev ) {
1499
1498
dev_err (dev , "Failed to allocate platform device\n" );
1500
- of_node_put (np );
1501
1499
return - ENOMEM ;
1502
1500
}
1503
1501
@@ -1506,7 +1504,6 @@ static int imx_gpcv2_probe(struct platform_device *pdev)
1506
1504
sizeof (domain_data -> domains [domain_index ]));
1507
1505
if (ret ) {
1508
1506
platform_device_put (pd_pdev );
1509
- of_node_put (np );
1510
1507
return ret ;
1511
1508
}
1512
1509
@@ -1523,7 +1520,6 @@ static int imx_gpcv2_probe(struct platform_device *pdev)
1523
1520
ret = platform_device_add (pd_pdev );
1524
1521
if (ret ) {
1525
1522
platform_device_put (pd_pdev );
1526
- of_node_put (np );
1527
1523
return ret ;
1528
1524
}
1529
1525
}
0 commit comments