diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-12-06 02:12:41 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-12-09 12:26:29 -0500 |
commit | 991a645d6b3320c07b8d78c58f8911f0b197e5d5 (patch) | |
tree | 3f621db3ceea3df7dcf5b124caae90c0d6db9d9a | |
parent | 6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (diff) |
regulator: stw481x-vmmc: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/regulator/stw481x-vmmc.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/regulator/stw481x-vmmc.c b/drivers/regulator/stw481x-vmmc.c index f78857bd6a15..a7e152696a02 100644 --- a/drivers/regulator/stw481x-vmmc.c +++ b/drivers/regulator/stw481x-vmmc.c | |||
@@ -74,7 +74,8 @@ static int stw481x_vmmc_regulator_probe(struct platform_device *pdev) | |||
74 | config.init_data = of_get_regulator_init_data(&pdev->dev, | 74 | config.init_data = of_get_regulator_init_data(&pdev->dev, |
75 | pdev->dev.of_node); | 75 | pdev->dev.of_node); |
76 | 76 | ||
77 | stw481x->vmmc_regulator = regulator_register(&vmmc_regulator, &config); | 77 | stw481x->vmmc_regulator = devm_regulator_register(&pdev->dev, |
78 | &vmmc_regulator, &config); | ||
78 | if (IS_ERR(stw481x->vmmc_regulator)) { | 79 | if (IS_ERR(stw481x->vmmc_regulator)) { |
79 | dev_err(&pdev->dev, | 80 | dev_err(&pdev->dev, |
80 | "error initializing STw481x VMMC regulator\n"); | 81 | "error initializing STw481x VMMC regulator\n"); |
@@ -85,14 +86,6 @@ static int stw481x_vmmc_regulator_probe(struct platform_device *pdev) | |||
85 | return 0; | 86 | return 0; |
86 | } | 87 | } |
87 | 88 | ||
88 | static int stw481x_vmmc_regulator_remove(struct platform_device *pdev) | ||
89 | { | ||
90 | struct stw481x *stw481x = dev_get_platdata(&pdev->dev); | ||
91 | |||
92 | regulator_unregister(stw481x->vmmc_regulator); | ||
93 | return 0; | ||
94 | } | ||
95 | |||
96 | static const struct of_device_id stw481x_vmmc_match[] = { | 89 | static const struct of_device_id stw481x_vmmc_match[] = { |
97 | { .compatible = "st,stw481x-vmmc", }, | 90 | { .compatible = "st,stw481x-vmmc", }, |
98 | {}, | 91 | {}, |
@@ -105,7 +98,6 @@ static struct platform_driver stw481x_vmmc_regulator_driver = { | |||
105 | .of_match_table = stw481x_vmmc_match, | 98 | .of_match_table = stw481x_vmmc_match, |
106 | }, | 99 | }, |
107 | .probe = stw481x_vmmc_regulator_probe, | 100 | .probe = stw481x_vmmc_regulator_probe, |
108 | .remove = stw481x_vmmc_regulator_remove, | ||
109 | }; | 101 | }; |
110 | 102 | ||
111 | module_platform_driver(stw481x_vmmc_regulator_driver); | 103 | module_platform_driver(stw481x_vmmc_regulator_driver); |