regulator: ab8500-ext: Make the return type of ab8500_ext_regulator_exit() void
PATCH 1/2 regulator: ab8500-ext: Make the return type of ab8500_ext_regulator_exit() void
ab8500_ext_regulator_exit() never fails.
Signed-off-by Axel Lin <[email protected]>
--- drivers/regulator/ab8500-ext.c | 4 +--- drivers/regulator/ab8500.c | 9 +++------ include/linux/regulator/ab8500.h | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-)
drivers/regulator/ab8500-ext.c +1 -3
@@ -385,7 +385,7 @@ int ab8500_ext_regulator_init(struct platform_device *pdev)return 0 ; } -int ab8500_ext_regulator_exit (struct platform_device *pdev) +void ab8500_ext_regulator_exit (struct platform_device *pdev) {int i;
@@ -398,8 +398,6 @@ int ab8500_ext_regulator_exit(struct platform_device *pdev)regulator_unregister (info->rdev); } - -return 0 ; }MODULE_LICENSE ("GPL v2" );
drivers/regulator/ab8500.c +3 -6
@@ -3194,12 +3194,9 @@ static int ab8500_regulator_remove(struct platform_device *pdev)regulator_unregister (info->regulator); } -if (!is_ab8505 (ab8500)) { -/* remove external regulators (after Vaux1, 2 and 3) */ - err =ab8500_ext_regulator_exit (pdev); -if (err) -return err; - } +/* remove external regulators (after Vaux1, 2 and 3) */ +if (!is_ab8505 (ab8500)) +ab8500_ext_regulator_exit (pdev);/* remove regulator debug */ err =ab8500_regulator_debug_exit (pdev);
include/linux/regulator/ab8500.h +1 -1
@@ -338,6 +338,6 @@ static inline int ab8500_regulator_debug_exit(struct platform_device *pdev)/* AB8500 external regulator functions. */ int ab8500_ext_regulator_init (struct platform_device *pdev); -int ab8500_ext_regulator_exit (struct platform_device *pdev); +void ab8500_ext_regulator_exit (struct platform_device *pdev);#endif
Signature · 1 line
1.7.10.4
PATCH 2/2 regulator: ab8500: Unregister ab8500-ext regulators in probe() failure path
Signed-off-by Axel Lin <[email protected]>
--- drivers/regulator/ab8500.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/regulator/ab8500.c +4 -1
@@ -3172,8 +3172,11 @@ static int ab8500_regulator_probe(struct platform_device *pdev)for (i =0 ; i < abx500_regulator.info_size; i++) { err =ab8500_regulator_register (pdev, &pdata->regulator[i], i,NULL ); -if (err <0 ) +if (err <0 ) { +if (!is_ab8505 (ab8500)) +ab8500_ext_regulator_exit (pdev);return err; + } }return 0 ;
Signature · 1 line
1.7.10.4
Re: [PATCH 2/2] regulator: ab8500: Unregister ab8500-ext regulators in probe() failure path
Quoted 1 line · Axel Lin
Signed-off-by Axel Lin <[email protected]>
Looks good to me.
Acked-by Bengt Jonsson <[email protected]>
Quoted 21 lines
--- drivers/regulator/ab8500.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/regulator/ab8500.c +4
-1@@ -3172,8 +3172,11 @@ static int ab8500_regulator_probe(struct platform_device *pdev)for (i =0 ; i < abx500_regulator.info_size; i++) { err =ab8500_regulator_register (pdev, &pdata->regulator[i], i,NULL ); -if (err <0 ) +if (err <0 ) { +if (!is_ab8505 (ab8500)) +ab8500_ext_regulator_exit (pdev);return err; + } }return 0 ;
Quoted 3 lines · Axel Lin
ab8500_ext_regulator_exit()never fails.Signed-off-by Axel Lin <[email protected]>
Looks good to me.
Acked-by Bengt Jonsson <[email protected]>
Quoted 60 lines
--- drivers/regulator/ab8500-ext.c | 4 +--- drivers/regulator/ab8500.c | 9 +++------ include/linux/regulator/ab8500.h | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-)drivers/regulator/ab8500-ext.c +1
-3@@ -385,7 +385,7 @@ int ab8500_ext_regulator_init(struct platform_device *pdev)return 0 ; } -int ab8500_ext_regulator_exit (struct platform_device *pdev) +void ab8500_ext_regulator_exit (struct platform_device *pdev) {int i;@@ -398,8 +398,6 @@ int ab8500_ext_regulator_exit(struct platform_device *pdev)regulator_unregister (info->rdev); } - -return 0 ; }MODULE_LICENSE ("GPL v2" );drivers/regulator/ab8500.c +3
-6@@ -3194,12 +3194,9 @@ static int ab8500_regulator_remove(struct platform_device *pdev)regulator_unregister (info->regulator); } -if (!is_ab8505 (ab8500)) { -/* remove external regulators (after Vaux1, 2 and 3) */ - err =ab8500_ext_regulator_exit (pdev); -if (err) -return err; - } +/* remove external regulators (after Vaux1, 2 and 3) */ +if (!is_ab8505 (ab8500)) +ab8500_ext_regulator_exit (pdev);/* remove regulator debug */ err =ab8500_regulator_debug_exit (pdev);include/linux/regulator/ab8500.h +1
-1@@ -338,6 +338,6 @@ static inline int ab8500_regulator_debug_exit(struct platform_device *pdev)/* AB8500 external regulator functions. */ int ab8500_ext_regulator_init (struct platform_device *pdev); -int ab8500_ext_regulator_exit (struct platform_device *pdev); +void ab8500_ext_regulator_exit (struct platform_device *pdev);#endif
Mark Brown
AppliedQuoted 1 line · Axel Lin
ab8500_ext_regulator_exit()never fails.
Applied both, thanks.