Repository navigation
Commit 018fd85
regulator: ab3100: Fix regulator register error handling
Ensure to unregister all regulators before return error in probe().
The regulator register order depends on the regulator ID pass to
ab3100_regulator_register() function. Thus we need to scan ab3100_regulator_desc
and find the index of successfully registered regulators, or alternatively just
call ab3100_regulators_remove() to unregister all registered regulators.
Since current code uses a static ab3100_regulators table, explicitly set
reg->rdev = NULL after regulator_unregister() call to ensure calling
ab3100_regulators_remove() in the unwind path always work.
Also move ab3100_regulators_remove() to avoid forward declaration.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>1 parent 8735bc2 commit 018fd85
1 file changed
Lines changed: 19 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
612 | 625 | | |
613 | 626 | | |
614 | 627 | | |
| |||
635 | 648 | | |
636 | 649 | | |
637 | 650 | | |
638 | | - | |
| 651 | + | |
| 652 | + | |
639 | 653 | | |
| 654 | + | |
640 | 655 | | |
641 | 656 | | |
642 | 657 | | |
| |||
695 | 710 | | |
696 | 711 | | |
697 | 712 | | |
698 | | - | |
| 713 | + | |
| 714 | + | |
699 | 715 | | |
| 716 | + | |
700 | 717 | | |
701 | 718 | | |
702 | 719 | | |
703 | 720 | | |
704 | 721 | | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | 722 | | |
718 | 723 | | |
719 | 724 | | |
| |||
0 commit comments