@@ -1458,7 +1458,7 @@ static int imx_gpcv2_probe(struct platform_device *pdev)
1458
1458
.max_register = SZ_4K ,
1459
1459
};
1460
1460
struct device * dev = & pdev -> dev ;
1461
- struct device_node * pgc_np , * np ;
1461
+ struct device_node * pgc_np ;
1462
1462
struct regmap * regmap ;
1463
1463
void __iomem * base ;
1464
1464
int ret ;
@@ -1480,7 +1480,7 @@ static int imx_gpcv2_probe(struct platform_device *pdev)
1480
1480
return ret ;
1481
1481
}
1482
1482
1483
- for_each_child_of_node (pgc_np , np ) {
1483
+ for_each_child_of_node_scoped (pgc_np , np ) {
1484
1484
struct platform_device * pd_pdev ;
1485
1485
struct imx_pgc_domain * domain ;
1486
1486
u32 domain_index ;
@@ -1491,7 +1491,6 @@ static int imx_gpcv2_probe(struct platform_device *pdev)
1491
1491
ret = of_property_read_u32 (np , "reg" , & domain_index );
1492
1492
if (ret ) {
1493
1493
dev_err (dev , "Failed to read 'reg' property\n" );
1494
- of_node_put (np );
1495
1494
return ret ;
1496
1495
}
1497
1496
@@ -1506,7 +1505,6 @@ static int imx_gpcv2_probe(struct platform_device *pdev)
1506
1505
domain_index );
1507
1506
if (!pd_pdev ) {
1508
1507
dev_err (dev , "Failed to allocate platform device\n" );
1509
- of_node_put (np );
1510
1508
return - ENOMEM ;
1511
1509
}
1512
1510
@@ -1515,7 +1513,6 @@ static int imx_gpcv2_probe(struct platform_device *pdev)
1515
1513
sizeof (domain_data -> domains [domain_index ]));
1516
1514
if (ret ) {
1517
1515
platform_device_put (pd_pdev );
1518
- of_node_put (np );
1519
1516
return ret ;
1520
1517
}
1521
1518
@@ -1532,7 +1529,6 @@ static int imx_gpcv2_probe(struct platform_device *pdev)
1532
1529
ret = platform_device_add (pd_pdev );
1533
1530
if (ret ) {
1534
1531
platform_device_put (pd_pdev );
1535
- of_node_put (np );
1536
1532
return ret ;
1537
1533
}
1538
1534
}
0 commit comments