From 706865afe54eee83c1f3d7e9ea2f51db8e986d7b Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Mon, 20 Mar 2017 12:51:48 +0100 Subject: dm: core: Add flags parameter to device_remove() This patch adds the flags parameter to device_remove() and changes all calls to this function to provide the default value of DM_REMOVE_NORMAL for "normal" device removal. This is in preparation for the driver specific pre-OS (e.g. DMA cancelling) remove support. Signed-off-by: Stefan Roese Cc: Simon Glass Acked-by: Simon Glass --- drivers/core/root.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/core/root.c') diff --git a/drivers/core/root.c b/drivers/core/root.c index 33cfde6a5c..d8c51fb496 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -178,7 +178,7 @@ int dm_init(void) int dm_uninit(void) { - device_remove(dm_root()); + device_remove(dm_root(), DM_REMOVE_NORMAL); device_unbind(dm_root()); return 0; -- cgit From bc85aa4030ab9ccfc1349c320b085a8b792c602e Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Mon, 27 Mar 2017 10:58:53 +0200 Subject: dm: core: Add dm_remove_devices_flags() and hook it into device_remove() The new function dm_remove_devices_flags() is intented for driver specific last-stage cleanup operations before the OS is started. This patch adds this functionality and hooks it into the common device_remove() function. Drivers wanting to use this feature for some last-stage removal calls, need to add one of the DM_REMOVE_xx flags to their driver .flags. Signed-off-by: Stefan Roese Reviewed-by: Simon Glass --- drivers/core/root.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/core/root.c') diff --git a/drivers/core/root.c b/drivers/core/root.c index d8c51fb496..42679d047c 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -184,6 +184,15 @@ int dm_uninit(void) return 0; } +#if CONFIG_IS_ENABLED(DM_DEVICE_REMOVE) +int dm_remove_devices_flags(uint flags) +{ + device_remove(dm_root(), flags); + + return 0; +} +#endif + int dm_scan_platdata(bool pre_reloc_only) { int ret; -- cgit