diff options
author | Stefan Roese <sr@denx.de> | 2017-03-27 10:58:53 +0200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-04-04 20:15:10 -0600 |
commit | bc85aa4030ab9ccfc1349c320b085a8b792c602e (patch) | |
tree | ed90ce03c7f456e194b68c3bbe1edb902602584a /include/dm/root.h | |
parent | 706865afe54eee83c1f3d7e9ea2f51db8e986d7b (diff) |
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 <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/root.h')
-rw-r--r-- | include/dm/root.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/dm/root.h b/include/dm/root.h index 3cf730dcee..058eb98923 100644 --- a/include/dm/root.h +++ b/include/dm/root.h @@ -115,4 +115,20 @@ int dm_init(void); */ int dm_uninit(void); +#if CONFIG_IS_ENABLED(DM_DEVICE_REMOVE) +/** + * dm_remove_devices_flags - Call remove function of all drivers with + * specific removal flags set to selectively + * remove drivers + * + * All devices with the matching flags set will be removed + * + * @flags: Flags for selective device removal + * @return 0 if OK, -ve on error + */ +int dm_remove_devices_flags(uint flags); +#else +static inline int dm_remove_devices_flags(uint flags) { return 0; } +#endif + #endif |