@@ -363,10 +363,9 @@ static struct is31fl32xx_led_data *is31fl32xx_find_led_data(
363
363
static int is31fl32xx_parse_dt (struct device * dev ,
364
364
struct is31fl32xx_priv * priv )
365
365
{
366
- struct device_node * child ;
367
366
int ret = 0 ;
368
367
369
- for_each_available_child_of_node (dev_of_node (dev ), child ) {
368
+ for_each_available_child_of_node_scoped (dev_of_node (dev ), child ) {
370
369
struct led_init_data init_data = {};
371
370
struct is31fl32xx_led_data * led_data =
372
371
& priv -> leds [priv -> num_leds ];
@@ -376,7 +375,7 @@ static int is31fl32xx_parse_dt(struct device *dev,
376
375
377
376
ret = is31fl32xx_parse_child_dt (dev , child , led_data );
378
377
if (ret )
379
- goto err ;
378
+ return ret ;
380
379
381
380
/* Detect if channel is already in use by another child */
382
381
other_led_data = is31fl32xx_find_led_data (priv ,
@@ -385,8 +384,7 @@ static int is31fl32xx_parse_dt(struct device *dev,
385
384
dev_err (dev ,
386
385
"Node %pOF 'reg' conflicts with another LED\n" ,
387
386
child );
388
- ret = - EINVAL ;
389
- goto err ;
387
+ return - EINVAL ;
390
388
}
391
389
392
390
init_data .fwnode = of_fwnode_handle (child );
@@ -396,17 +394,13 @@ static int is31fl32xx_parse_dt(struct device *dev,
396
394
if (ret ) {
397
395
dev_err (dev , "Failed to register LED for %pOF: %d\n" ,
398
396
child , ret );
399
- goto err ;
397
+ return ret ;
400
398
}
401
399
402
400
priv -> num_leds ++ ;
403
401
}
404
402
405
403
return 0 ;
406
-
407
- err :
408
- of_node_put (child );
409
- return ret ;
410
404
}
411
405
412
406
static const struct of_device_id of_is31fl32xx_match [] = {
0 commit comments