Skip to content

Commit

Permalink
mfd: qcom-spmi-pmic: Use devm_of_platform_populate()
Browse files Browse the repository at this point in the history
Usage of  devm_of_platform_populate() simplify driver code
by allowing to delete pmic_spmi_remove().

Signed-off-by: Benjamin Gaignard <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
  • Loading branch information
Benjamin-Gaignard authored and Lee Jones committed Jul 6, 2017
1 parent 124e9de commit 6f00f8c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/mfd/qcom-spmi-pmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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,
Expand Down

0 comments on commit 6f00f8c

Please sign in to comment.