Commit 6f00f8c8 authored by Benjamin Gaignard's avatar Benjamin Gaignard Committed by Lee Jones

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: default avatarBenjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 124e9deb
...@@ -120,7 +120,6 @@ static const struct regmap_config spmi_regmap_config = { ...@@ -120,7 +120,6 @@ static const struct regmap_config spmi_regmap_config = {
static int pmic_spmi_probe(struct spmi_device *sdev) static int pmic_spmi_probe(struct spmi_device *sdev)
{ {
struct device_node *root = sdev->dev.of_node;
struct regmap *regmap; struct regmap *regmap;
regmap = devm_regmap_init_spmi_ext(sdev, &spmi_regmap_config); regmap = devm_regmap_init_spmi_ext(sdev, &spmi_regmap_config);
...@@ -131,19 +130,13 @@ static int pmic_spmi_probe(struct spmi_device *sdev) ...@@ -131,19 +130,13 @@ static int pmic_spmi_probe(struct spmi_device *sdev)
if (sdev->usid % 2 == 0) if (sdev->usid % 2 == 0)
pmic_spmi_show_revid(regmap, &sdev->dev); pmic_spmi_show_revid(regmap, &sdev->dev);
return of_platform_populate(root, NULL, NULL, &sdev->dev); return devm_of_platform_populate(&sdev->dev);
}
static void pmic_spmi_remove(struct spmi_device *sdev)
{
of_platform_depopulate(&sdev->dev);
} }
MODULE_DEVICE_TABLE(of, pmic_spmi_id_table); MODULE_DEVICE_TABLE(of, pmic_spmi_id_table);
static struct spmi_driver pmic_spmi_driver = { static struct spmi_driver pmic_spmi_driver = {
.probe = pmic_spmi_probe, .probe = pmic_spmi_probe,
.remove = pmic_spmi_remove,
.driver = { .driver = {
.name = "pmic-spmi", .name = "pmic-spmi",
.of_match_table = pmic_spmi_id_table, .of_match_table = pmic_spmi_id_table,
......
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