summaryrefslogtreecommitdiff
path: root/include/reset.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-07-06 12:54:27 -0600
committerSimon Glass <sjg@chromium.org>2015-07-21 17:39:31 -0600
commit1704d083b3a1acfe167dc2e3b687263f05a65087 (patch)
treef2c6f522410a574ae46fa0ac871b1935cc7b73a0 /include/reset.h
parentdc6f4d3a55c7e26af6b0cd41bcd9486b16a1ab9e (diff)
downloadu-boot-imx-1704d083b3a1acfe167dc2e3b687263f05a65087.zip
u-boot-imx-1704d083b3a1acfe167dc2e3b687263f05a65087.tar.gz
u-boot-imx-1704d083b3a1acfe167dc2e3b687263f05a65087.tar.bz2
dm: reset: Allow reset_walk() to return
Add a new reset_walk_halt() function to cause a reset and then halt on failure. The reset_walk() function returns an error code. This is needed for testing since otherwise U-Boot will halt in the middle of a test. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/reset.h')
-rw-r--r--include/reset.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/reset.h b/include/reset.h
index d29e108..383761e 100644
--- a/include/reset.h
+++ b/include/reset.h
@@ -51,8 +51,17 @@ int reset_request(struct udevice *dev, enum reset_t type);
* If this function fails to reset, it will display a message and halt
*
* @type: Reset type to request
+ * @return -EINPROGRESS if a reset is in progress, -ENOSYS if not available
*/
-void reset_walk(enum reset_t type);
+int reset_walk(enum reset_t type);
+
+/**
+ * reset_walk_halt() - try to reset, otherwise halt
+ *
+ * This calls reset_walk(). If it returns, indicating that reset is not
+ * supported, it prints a message and halts.
+ */
+void reset_walk_halt(enum reset_t type);
/**
* reset_cpu() - calls reset_walk(RESET_WARM)