File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -1368,7 +1368,6 @@ static int lpg_add_led(struct lpg *lpg, struct device_node *np)
1368
1368
{
1369
1369
struct led_init_data init_data = {};
1370
1370
struct led_classdev * cdev ;
1371
- struct device_node * child ;
1372
1371
struct mc_subled * info ;
1373
1372
struct lpg_led * led ;
1374
1373
const char * state ;
@@ -1399,12 +1398,10 @@ static int lpg_add_led(struct lpg *lpg, struct device_node *np)
1399
1398
if (!info )
1400
1399
return - ENOMEM ;
1401
1400
i = 0 ;
1402
- for_each_available_child_of_node (np , child ) {
1401
+ for_each_available_child_of_node_scoped (np , child ) {
1403
1402
ret = lpg_parse_channel (lpg , child , & led -> channels [i ]);
1404
- if (ret < 0 ) {
1405
- of_node_put (child );
1403
+ if (ret < 0 )
1406
1404
return ret ;
1407
- }
1408
1405
1409
1406
info [i ].color_index = led -> channels [i ]-> color ;
1410
1407
info [i ].intensity = 0 ;
@@ -1600,7 +1597,6 @@ static int lpg_init_sdam(struct lpg *lpg)
1600
1597
1601
1598
static int lpg_probe (struct platform_device * pdev )
1602
1599
{
1603
- struct device_node * np ;
1604
1600
struct lpg * lpg ;
1605
1601
int ret ;
1606
1602
int i ;
@@ -1640,12 +1636,10 @@ static int lpg_probe(struct platform_device *pdev)
1640
1636
if (ret < 0 )
1641
1637
return ret ;
1642
1638
1643
- for_each_available_child_of_node (pdev -> dev .of_node , np ) {
1639
+ for_each_available_child_of_node_scoped (pdev -> dev .of_node , np ) {
1644
1640
ret = lpg_add_led (lpg , np );
1645
- if (ret ) {
1646
- of_node_put (np );
1641
+ if (ret )
1647
1642
return ret ;
1648
- }
1649
1643
}
1650
1644
1651
1645
for (i = 0 ; i < lpg -> num_channels ; i ++ )
You can’t perform that action at this time.
0 commit comments