@@ -1366,7 +1366,7 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev)
1366
1366
unsigned int id_value ;
1367
1367
int ret , node = 0 ;
1368
1368
void __iomem * base ;
1369
- struct device_node * dn = dev -> of_node , * child ;
1369
+ struct device_node * dn = dev -> of_node ;
1370
1370
1371
1371
if (of_get_child_count (dn ) == 0 )
1372
1372
return - ENODEV ;
@@ -1438,7 +1438,7 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev)
1438
1438
1439
1439
sp -> autoconf = of_property_read_bool (dn , "cdns,autoconf" );
1440
1440
1441
- for_each_available_child_of_node (dn , child ) {
1441
+ for_each_available_child_of_node_scoped (dn , child ) {
1442
1442
struct phy * gphy ;
1443
1443
1444
1444
if (!(of_node_name_eq (child , "phy" ) ||
@@ -1452,7 +1452,6 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev)
1452
1452
dev_err (dev , "failed to get reset %s\n" ,
1453
1453
child -> full_name );
1454
1454
ret = PTR_ERR (sp -> phys [node ].lnk_rst );
1455
- of_node_put (child );
1456
1455
goto put_control ;
1457
1456
}
1458
1457
@@ -1461,7 +1460,6 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev)
1461
1460
if (ret ) {
1462
1461
dev_err (dev , "missing property in node %s\n" ,
1463
1462
child -> name );
1464
- of_node_put (child );
1465
1463
reset_control_put (sp -> phys [node ].lnk_rst );
1466
1464
goto put_control ;
1467
1465
}
@@ -1475,7 +1473,6 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev)
1475
1473
gphy = devm_phy_create (dev , child , & noop_ops );
1476
1474
if (IS_ERR (gphy )) {
1477
1475
ret = PTR_ERR (gphy );
1478
- of_node_put (child );
1479
1476
reset_control_put (sp -> phys [node ].lnk_rst );
1480
1477
goto put_control ;
1481
1478
}
0 commit comments