summaryrefslogtreecommitdiff
path: root/include/sbi_utils
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2021-11-06 12:54:51 +0300
committerAnup Patel <anup@brainfault.org>2021-11-08 08:20:48 +0300
commitbe245acfffa297b5ed4e0c7bb473a6bd55231bf8 (patch)
tree836a0f3066e523588749c86b311166a6846a5f17 /include/sbi_utils
parent57f094e67e0642a16889e9bce64266a4e378683b (diff)
downloadopensbi-be245acfffa297b5ed4e0c7bb473a6bd55231bf8.tar.xz
lib: sbi: error handling in fdt_reset_init()
The initialization of a reset driver may fail for various reasons, like a PMIC based reset driver not finding the required I2C driver. The return code of the init routine may take other error values than -ENODEV. If the initialization of a reset driver fails, this should not lead to the board hanging. It is enough that the reset driver does not call sbi_system_reset_add_device() to avoid invoking the driver for a device that could not be initialized. Change the return type of fdt_reset_init() to void. Print a message if an error occurs. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Dong Du <Dd_nirvana@sjtu.edu.cn> Reviewed-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'include/sbi_utils')
-rw-r--r--include/sbi_utils/reset/fdt_reset.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/sbi_utils/reset/fdt_reset.h b/include/sbi_utils/reset/fdt_reset.h
index 6d58697..46167b9 100644
--- a/include/sbi_utils/reset/fdt_reset.h
+++ b/include/sbi_utils/reset/fdt_reset.h
@@ -17,6 +17,11 @@ struct fdt_reset {
int (*init)(void *fdt, int nodeoff, const struct fdt_match *match);
};
-int fdt_reset_init(void);
+/**
+ * fdt_reset_init() - initialize reset drivers based on the device-tree
+ *
+ * This function shall be invoked in final init.
+ */
+void fdt_reset_init(void);
#endif