summaryrefslogtreecommitdiff
path: root/drivers/mfd/mfd-core.c
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2021-03-01 17:42:19 +0300
committerLee Jones <lee.jones@linaro.org>2021-04-14 18:06:07 +0300
commit42e59982917a25ad254b74e6e8decee5e684763d (patch)
tree570c1f9847cb31046bf62b6b2a499a8a6660e810 /drivers/mfd/mfd-core.c
parent586478bfc9f7e16504d6f64cf18bcbdf6fd0cbc9 (diff)
downloadlinux-42e59982917a25ad254b74e6e8decee5e684763d.tar.xz
mfd: core: Add support for software nodes
The old device property API is going to be removed and replaced with the newer software node API. This prepares MFD subsystem for the transition. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/mfd-core.c')
-rw-r--r--drivers/mfd/mfd-core.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index fc00aaccb5f7..e24008b94aac 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -244,6 +244,12 @@ static int mfd_add_device(struct device *parent, int id,
goto fail_of_entry;
}
+ if (cell->swnode) {
+ ret = device_add_software_node(&pdev->dev, cell->swnode);
+ if (ret)
+ goto fail_of_entry;
+ }
+
for (r = 0; r < cell->num_resources; r++) {
res[r].name = cell->resources[r].name;
res[r].flags = cell->resources[r].flags;
@@ -304,6 +310,7 @@ fail_of_entry:
list_del(&of_entry->list);
kfree(of_entry);
}
+ device_remove_software_node(&pdev->dev);
fail_alias:
regulator_bulk_unregister_supply_alias(&pdev->dev,
cell->parent_supplies,
@@ -372,6 +379,8 @@ static int mfd_remove_devices_fn(struct device *dev, void *data)
regulator_bulk_unregister_supply_alias(dev, cell->parent_supplies,
cell->num_parent_supplies);
+ device_remove_software_node(&pdev->dev);
+
platform_device_unregister(pdev);
return 0;
}