diff options
author | Simon Glass <sjg@chromium.org> | 2014-07-23 12:55:01 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-07-23 13:07:24 (GMT) |
commit | 9adbd7a116d62349eb0a85b5a08ab3ff0a12d556 (patch) | |
tree | 2c5eb3c92fb02ac1f364963becf4dd1321cd3d13 | |
parent | 7497812d47d4ad17172ec373469a33a6ab8b257e (diff) | |
download | u-boot-fsl-qoriq-9adbd7a116d62349eb0a85b5a08ab3ff0a12d556.tar.xz |
dm: Provide a way to shut down driver model
Add a new method which removes and unbinds all drivers.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Vasut <marex@denx.de>
-rw-r--r-- | drivers/core/root.c | 8 | ||||
-rw-r--r-- | include/dm/root.h | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/core/root.c b/drivers/core/root.c index ac1c164..346d462 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -56,6 +56,14 @@ int dm_init(void) return 0; } +int dm_uninit(void) +{ + device_remove(dm_root()); + device_unbind(dm_root()); + + return 0; +} + int dm_scan_platdata(void) { int ret; diff --git a/include/dm/root.h b/include/dm/root.h index a4826a6..35818b1 100644 --- a/include/dm/root.h +++ b/include/dm/root.h @@ -50,4 +50,12 @@ int dm_scan_fdt(const void *blob); */ int dm_init(void); +/** + * dm_uninit - Uninitialise Driver Model structures + * + * All devices will be removed and unbound + * @return 0 if OK, -ve on error + */ +int dm_uninit(void); + #endif |