diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-04-27 01:58:08 -0400 |
---|---|---|
committer | Mark Brown <broonie@sirena.org.uk> | 2013-04-27 21:11:19 -0400 |
commit | 020501f1a0911af70873e4d3d122b2e1889ccd03 (patch) | |
tree | 0a5692eb87cfaf0b7ec46ac845a1d79a9fd576d8 /drivers/regulator/s5m8767.c | |
parent | 1e4b545cdd93318379c6b1fb0a99536fa3260f53 (diff) |
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>
Diffstat (limited to 'drivers/regulator/s5m8767.c')
-rw-r--r-- | drivers/regulator/s5m8767.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index 8a831947c351..2dd74e254397 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c | |||
@@ -923,8 +923,7 @@ static int s5m8767_pmic_probe(struct platform_device *pdev) | |||
923 | return 0; | 923 | return 0; |
924 | err: | 924 | err: |
925 | for (i = 0; i < s5m8767->num_regulators; i++) | 925 | for (i = 0; i < s5m8767->num_regulators; i++) |
926 | if (rdev[i]) | 926 | regulator_unregister(rdev[i]); |
927 | regulator_unregister(rdev[i]); | ||
928 | 927 | ||
929 | return ret; | 928 | return ret; |
930 | } | 929 | } |
@@ -936,8 +935,7 @@ static int s5m8767_pmic_remove(struct platform_device *pdev) | |||
936 | int i; | 935 | int i; |
937 | 936 | ||
938 | for (i = 0; i < s5m8767->num_regulators; i++) | 937 | for (i = 0; i < s5m8767->num_regulators; i++) |
939 | if (rdev[i]) | 938 | regulator_unregister(rdev[i]); |
940 | regulator_unregister(rdev[i]); | ||
941 | 939 | ||
942 | return 0; | 940 | return 0; |
943 | } | 941 | } |