aboutsummaryrefslogtreecommitdiff
path: root/drivers/core/root.c
diff options
context:
space:
mode:
authorMarek Vasut2021-01-24 14:32:46 -0700
committerSimon Glass2021-02-03 03:38:41 -0700
commitcc6f4c8f2574472e359cb915811f6f93efdfcad4 (patch)
tree67b550a1af9bd00eb5fed3bc5d257eda641abcae /drivers/core/root.c
parentc51d2e704a1c89d504b379b133bd552c3387fa6c (diff)
dm: core: Add late driver remove option
Add another flag to the DM core which could be assigned to drivers and which makes those drivers call their remove callbacks last, just before booting OS and after all the other drivers finished with their remove callbacks. This is necessary for things like clock drivers, where the other drivers might depend on the clock driver in their remove callbacks. Prime example is the mmc subsystem, which can reconfigure a card from HS mode to slower modes in the remove callback and for that it needs to reconfigure the controller clock. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/root.c')
-rw-r--r--drivers/core/root.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/core/root.c b/drivers/core/root.c
index 2bfa75b4725..7ef2ec2da27 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -162,6 +162,8 @@ int dm_init(bool of_live)
int dm_uninit(void)
{
+ /* Remove non-vital devices first */
+ device_remove(dm_root(), DM_REMOVE_NON_VITAL);
device_remove(dm_root(), DM_REMOVE_NORMAL);
device_unbind(dm_root());
gd->dm_root = NULL;