Commit 7bd4b92
leds: lm3532: 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-8-95c0614b38c8@gmail.com
Signed-off-by: Lee Jones <[email protected]>1 parent 42b4967 commit 7bd4b92
1 file changed
+7
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
554 | | - | |
555 | 554 | | |
556 | 555 | | |
557 | 556 | | |
| |||
587 | 586 | | |
588 | 587 | | |
589 | 588 | | |
590 | | - | |
| 589 | + | |
591 | 590 | | |
592 | 591 | | |
593 | 592 | | |
| |||
599 | 598 | | |
600 | 599 | | |
601 | 600 | | |
602 | | - | |
| 601 | + | |
603 | 602 | | |
604 | 603 | | |
605 | 604 | | |
| |||
613 | 612 | | |
614 | 613 | | |
615 | 614 | | |
616 | | - | |
| 615 | + | |
617 | 616 | | |
618 | 617 | | |
619 | 618 | | |
| |||
647 | 646 | | |
648 | 647 | | |
649 | 648 | | |
650 | | - | |
| 649 | + | |
651 | 650 | | |
652 | 651 | | |
653 | 652 | | |
| |||
657 | 656 | | |
658 | 657 | | |
659 | 658 | | |
660 | | - | |
| 659 | + | |
661 | 660 | | |
662 | 661 | | |
663 | 662 | | |
664 | 663 | | |
665 | 664 | | |
666 | 665 | | |
667 | | - | |
| 666 | + | |
668 | 667 | | |
669 | 668 | | |
670 | 669 | | |
671 | 670 | | |
672 | | - | |
673 | 671 | | |
674 | | - | |
675 | | - | |
676 | | - | |
| 672 | + | |
677 | 673 | | |
678 | 674 | | |
679 | 675 | | |
| |||
0 commit comments