Commit 020501f1a0911af70873e4d3d122b2e1889ccd03
Committed by
Mark Brown
1 parent
1e4b545cdd
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
regulator: Remove NULL test before calling regulator_unregister()
It's safe to call regulator_unregister() with NULL, thus remove the NULL test before regulator_unregister() calls. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@sirena.org.uk>
Showing 5 changed files with 7 additions and 14 deletions Side-by-side Diff
drivers/regulator/max1586.c
drivers/regulator/max8649.c
... | ... | @@ -275,10 +275,8 @@ |
275 | 275 | { |
276 | 276 | struct max8649_regulator_info *info = i2c_get_clientdata(client); |
277 | 277 | |
278 | - if (info) { | |
279 | - if (info->regulator) | |
280 | - regulator_unregister(info->regulator); | |
281 | - } | |
278 | + if (info) | |
279 | + regulator_unregister(info->regulator); | |
282 | 280 | |
283 | 281 | return 0; |
284 | 282 | } |
drivers/regulator/max8660.c
drivers/regulator/s5m8767.c
... | ... | @@ -923,8 +923,7 @@ |
923 | 923 | return 0; |
924 | 924 | err: |
925 | 925 | for (i = 0; i < s5m8767->num_regulators; i++) |
926 | - if (rdev[i]) | |
927 | - regulator_unregister(rdev[i]); | |
926 | + regulator_unregister(rdev[i]); | |
928 | 927 | |
929 | 928 | return ret; |
930 | 929 | } |
... | ... | @@ -936,8 +935,7 @@ |
936 | 935 | int i; |
937 | 936 | |
938 | 937 | for (i = 0; i < s5m8767->num_regulators; i++) |
939 | - if (rdev[i]) | |
940 | - regulator_unregister(rdev[i]); | |
938 | + regulator_unregister(rdev[i]); | |
941 | 939 | |
942 | 940 | return 0; |
943 | 941 | } |
drivers/regulator/tps6524x-regulator.c