lib: sbi: error handling in fdt_reset_init()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 6 Nov 2021 09:54:51 +0000 (10:54 +0100)
committerAnup Patel <anup@brainfault.org>
Mon, 8 Nov 2021 05:20:48 +0000 (10:50 +0530)
commitbe245acfffa297b5ed4e0c7bb473a6bd55231bf8
tree836a0f3066e523588749c86b311166a6846a5f17
parent57f094e67e0642a16889e9bce64266a4e378683b
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>
include/sbi_utils/reset/fdt_reset.h
lib/utils/reset/fdt_reset.c