mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-25 07:41:42 +01:00
lib: utils/reset: Use fdt_driver for initialization
The reset driver subsystem does not need any extra data, so it can use `struct fdt_driver` directly. The generic fdt_reset_init() performs a best-effort initialization of all matching DT nodes. Platform-specific logic expects exactly one DT node to match a single driver. This is accomplished by using fdt_driver_init_one() with a local list containing that one driver. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:

committed by
Anup Patel

parent
1f8db2f18f
commit
6d9ad492db
@@ -11,19 +11,10 @@
|
||||
#define __FDT_RESET_H__
|
||||
|
||||
#include <sbi/sbi_types.h>
|
||||
|
||||
struct fdt_reset {
|
||||
const struct fdt_match *match_table;
|
||||
int (*init)(const void *fdt, int nodeoff, const struct fdt_match *match);
|
||||
};
|
||||
#include <sbi_utils/fdt/fdt_driver.h>
|
||||
|
||||
#ifdef CONFIG_FDT_RESET
|
||||
|
||||
/**
|
||||
* fdt_reset_driver_init() - initialize reset driver based on the device-tree
|
||||
*/
|
||||
int fdt_reset_driver_init(const void *fdt, struct fdt_reset *drv);
|
||||
|
||||
/**
|
||||
* fdt_reset_init() - initialize reset drivers based on the device-tree
|
||||
*
|
||||
@@ -33,10 +24,6 @@ void fdt_reset_init(const void *fdt);
|
||||
|
||||
#else
|
||||
|
||||
static inline int fdt_reset_driver_init(const void *fdt, struct fdt_reset *drv)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void fdt_reset_init(const void *fdt) { }
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user