forked from Mirrors/opensbi

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>
28 lines
547 B
C
28 lines
547 B
C
/*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*
|
|
* Copyright (c) 2020 Western Digital Corporation or its affiliates.
|
|
*
|
|
* Authors:
|
|
* Anup Patel <anup.patel@wdc.com>
|
|
*/
|
|
|
|
#ifndef __FDT_RESET_H__
|
|
#define __FDT_RESET_H__
|
|
|
|
#include <sbi/sbi_types.h>
|
|
|
|
struct fdt_reset {
|
|
const struct fdt_match *match_table;
|
|
int (*init)(void *fdt, int nodeoff, const struct fdt_match *match);
|
|
};
|
|
|
|
/**
|
|
* 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
|