diff options
author | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2020-11-18 15:32:36 +0000 |
---|---|---|
committer | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2020-11-18 16:07:25 +0000 |
commit | 56cc6f1ae1903ac1c2a73841683356f07a366f13 (patch) | |
tree | 6797ec52ab87f3b281c704d488c17c90966a6b6b | |
parent | 10a2291bce563f26af71b0d819a165465245b55f (diff) |
mfd: core: cleanup of_node on mfd_cell delete
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
-rw-r--r-- | drivers/mfd/mfd-core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index fc00aaccb5f7..3e845be895ac 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -359,6 +359,7 @@ static int mfd_remove_devices_fn(struct device *dev, void *data) struct platform_device *pdev; const struct mfd_cell *cell; int *level = data; + struct mfd_of_node_entry *of_entry, *tmp; if (dev->type != &mfd_dev_type) return 0; @@ -372,6 +373,12 @@ static int mfd_remove_devices_fn(struct device *dev, void *data) regulator_bulk_unregister_supply_alias(dev, cell->parent_supplies, cell->num_parent_supplies); + list_for_each_entry_safe(of_entry, tmp, &mfd_of_node_list, list) + if (of_entry->dev == &pdev->dev) { + list_del(&of_entry->list); + kfree(of_entry); + } + platform_device_unregister(pdev); return 0; } |