Commit ba35b9a
leds: lp50xx: Switch to device_for_each_child_node_scoped()
Switch to device_for_each_child_node_scoped() to simplify the code by
removing the need for calls to fwnode_handle_put() in the error paths.
This also prevents possible memory leaks if new error paths are added
without the required call to fwnode_handle_put().
After switching to the scoped variant, there is no longer need for a
jump to 'child_out', as an immediate return is possible.
Signed-off-by: Javier Carrasco <[email protected]>
Link: https://lore.kernel.org/r/20240927-leds_device_for_each_child_node_scoped-v1-10-95c0614b38c8@gmail.com
Signed-off-by: Lee Jones <[email protected]>1 parent 6e2d1d8 commit ba35b9a
1 file changed
+7
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
438 | 437 | | |
439 | 438 | | |
440 | 439 | | |
| |||
454 | 453 | | |
455 | 454 | | |
456 | 455 | | |
457 | | - | |
| 456 | + | |
458 | 457 | | |
459 | 458 | | |
460 | 459 | | |
461 | 460 | | |
462 | | - | |
| 461 | + | |
463 | 462 | | |
464 | 463 | | |
465 | 464 | | |
466 | 465 | | |
467 | | - | |
| 466 | + | |
468 | 467 | | |
469 | 468 | | |
470 | 469 | | |
| |||
475 | 474 | | |
476 | 475 | | |
477 | 476 | | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
| 477 | + | |
| 478 | + | |
482 | 479 | | |
483 | 480 | | |
484 | 481 | | |
485 | 482 | | |
486 | 483 | | |
487 | 484 | | |
488 | 485 | | |
489 | | - | |
| 486 | + | |
490 | 487 | | |
491 | 488 | | |
492 | 489 | | |
| |||
504 | 501 | | |
505 | 502 | | |
506 | 503 | | |
507 | | - | |
| 504 | + | |
508 | 505 | | |
509 | 506 | | |
510 | 507 | | |
511 | 508 | | |
512 | 509 | | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | 510 | | |
518 | 511 | | |
519 | 512 | | |
| |||
0 commit comments