diff options
Diffstat (limited to 'drivers/regulator/s2mps11.c')
-rw-r--r-- | drivers/regulator/s2mps11.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c index 5eba2ff8c0e8..333677d68d0e 100644 --- a/drivers/regulator/s2mps11.c +++ b/drivers/regulator/s2mps11.c @@ -448,33 +448,17 @@ common_reg: config.of_node = rdata[i].of_node; } - s2mps11->rdev[i] = regulator_register(®ulators[i], &config); + s2mps11->rdev[i] = devm_regulator_register(&pdev->dev, + ®ulators[i], &config); if (IS_ERR(s2mps11->rdev[i])) { ret = PTR_ERR(s2mps11->rdev[i]); dev_err(&pdev->dev, "regulator init failed for %d\n", i); - s2mps11->rdev[i] = NULL; - goto err; + return ret; } } return 0; -err: - for (i = 0; i < S2MPS11_REGULATOR_MAX; i++) - regulator_unregister(s2mps11->rdev[i]); - - return ret; -} - -static int s2mps11_pmic_remove(struct platform_device *pdev) -{ - struct s2mps11_info *s2mps11 = platform_get_drvdata(pdev); - int i; - - for (i = 0; i < S2MPS11_REGULATOR_MAX; i++) - regulator_unregister(s2mps11->rdev[i]); - - return 0; } static const struct platform_device_id s2mps11_pmic_id[] = { @@ -489,7 +473,6 @@ static struct platform_driver s2mps11_pmic_driver = { .owner = THIS_MODULE, }, .probe = s2mps11_pmic_probe, - .remove = s2mps11_pmic_remove, .id_table = s2mps11_pmic_id, }; |