Commit 413be59e authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: tps65218: Remove unnecessary regulator_unregister call

Current code uses devm_regulator_register() so the we don't need to explicitly
call regulator_unregister() in .remove.
And then we don't need to save rdev pointer to tps->rdev[id].
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Acked-by: default avatarKeerthy <j-keerthy@ti.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent c46b5295
...@@ -267,23 +267,6 @@ static int tps65218_regulator_probe(struct platform_device *pdev) ...@@ -267,23 +267,6 @@ static int tps65218_regulator_probe(struct platform_device *pdev)
return PTR_ERR(rdev); return PTR_ERR(rdev);
} }
/* Save regulator */
tps->rdev[id] = rdev;
return 0;
}
static int tps65218_regulator_remove(struct platform_device *pdev)
{
struct tps65218 *tps = platform_get_drvdata(pdev);
const struct of_device_id *match;
const struct tps_info *template;
match = of_match_device(tps65218_of_match, &pdev->dev);
template = match->data;
regulator_unregister(tps->rdev[template->id]);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
...@@ -294,7 +277,6 @@ static struct platform_driver tps65218_regulator_driver = { ...@@ -294,7 +277,6 @@ static struct platform_driver tps65218_regulator_driver = {
.of_match_table = of_match_ptr(tps65218_of_match), .of_match_table = of_match_ptr(tps65218_of_match),
}, },
.probe = tps65218_regulator_probe, .probe = tps65218_regulator_probe,
.remove = tps65218_regulator_remove,
}; };
module_platform_driver(tps65218_regulator_driver); module_platform_driver(tps65218_regulator_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment