From 020501f1a0911af70873e4d3d122b2e1889ccd03 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sat, 27 Apr 2013 13:58:08 +0800 Subject: 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 Signed-off-by: Mark Brown --- drivers/regulator/s5m8767.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/regulator/s5m8767.c') 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) return 0; err: for (i = 0; i < s5m8767->num_regulators; i++) - if (rdev[i]) - regulator_unregister(rdev[i]); + regulator_unregister(rdev[i]); return ret; } @@ -936,8 +935,7 @@ static int s5m8767_pmic_remove(struct platform_device *pdev) int i; for (i = 0; i < s5m8767->num_regulators; i++) - if (rdev[i]) - regulator_unregister(rdev[i]); + regulator_unregister(rdev[i]); return 0; } -- cgit