summaryrefslogtreecommitdiff
path: root/drivers/mfd/qcom-spmi-pmic.c
diff options
context:
space:
mode:
authorBenjamin Gaignard <benjamin.gaignard@linaro.org>2017-05-29 17:46:00 +0200
committerLee Jones <lee.jones@linaro.org>2017-07-06 08:29:12 +0100
commit6f00f8c8635f79b470eab6496265d63c1e1db3ed (patch)
treeb61622062275c2809f8033eaad2fa04a631f7977 /drivers/mfd/qcom-spmi-pmic.c
parent124e9deb1c40cc8c6fdf56bcb851500423eb9f13 (diff)
downloadlinux-6f00f8c8635f79b470eab6496265d63c1e1db3ed.tar.gz
mfd: qcom-spmi-pmic: Use devm_of_platform_populate()
Usage of devm_of_platform_populate() simplify driver code by allowing to delete pmic_spmi_remove(). Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/qcom-spmi-pmic.c')
-rw-r--r--drivers/mfd/qcom-spmi-pmic.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/mfd/qcom-spmi-pmic.c b/drivers/mfd/qcom-spmi-pmic.c
index 8653e8b9bb4f..2022bdfa7ab4 100644
--- a/drivers/mfd/qcom-spmi-pmic.c
+++ b/drivers/mfd/qcom-spmi-pmic.c
@@ -120,7 +120,6 @@ static const struct regmap_config spmi_regmap_config = {
static int pmic_spmi_probe(struct spmi_device *sdev)
{
- struct device_node *root = sdev->dev.of_node;
struct regmap *regmap;
regmap = devm_regmap_init_spmi_ext(sdev, &spmi_regmap_config);
@@ -131,19 +130,13 @@ static int pmic_spmi_probe(struct spmi_device *sdev)
if (sdev->usid % 2 == 0)
pmic_spmi_show_revid(regmap, &sdev->dev);
- return of_platform_populate(root, NULL, NULL, &sdev->dev);
-}
-
-static void pmic_spmi_remove(struct spmi_device *sdev)
-{
- of_platform_depopulate(&sdev->dev);
+ return devm_of_platform_populate(&sdev->dev);
}
MODULE_DEVICE_TABLE(of, pmic_spmi_id_table);
static struct spmi_driver pmic_spmi_driver = {
.probe = pmic_spmi_probe,
- .remove = pmic_spmi_remove,
.driver = {
.name = "pmic-spmi",
.of_match_table = pmic_spmi_id_table,