diff options
author | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2020-11-18 15:32:36 +0000 |
---|---|---|
committer | Dmitry Baryshkov <dmitry.baryshkov@linaro.org> | 2020-12-29 00:37:30 +0300 |
commit | 32ec84c190f0f7f6996b1e8eba1116b8d4027858 (patch) | |
tree | 247f1bdd968a536bc6e22b3e7696b2a451c0cb9a | |
parent | c70a4a8192a669904392f84e60573094328d8c95 (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; } |