summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSamuel Holland <samuel.holland@sifive.com>2024-11-12 01:02:54 +0300
committerAnup Patel <anup@brainfault.org>2024-11-28 15:22:58 +0300
commita524f0a507de18f150ea33ac923117291c6d1d81 (patch)
treedcf3910d851386ddcd6c37948b4232b37d816081 /include
parent6d9ad492dbfdda00add7ff15a8599736f46d040a (diff)
downloadopensbi-a524f0a507de18f150ea33ac923117291c6d1d81.tar.xz
lib: utils/serial: Use fdt_driver for initialization
The serial driver subsystem does not need any extra data, so it can use `struct fdt_driver` directly. The generic fdt_serial_init() first attempts to match the chosen stdout device, and upon failure matches the first available serial device in the DT. It is a fatal error if no such device is found. This matches the behavior of fdt_driver_init_one(). Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'include')
-rw-r--r--include/sbi_utils/serial/fdt_serial.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/include/sbi_utils/serial/fdt_serial.h b/include/sbi_utils/serial/fdt_serial.h
index 572475c..5777610 100644
--- a/include/sbi_utils/serial/fdt_serial.h
+++ b/include/sbi_utils/serial/fdt_serial.h
@@ -11,14 +11,10 @@
#define __FDT_SERIAL_H__
#include <sbi/sbi_types.h>
+#include <sbi_utils/fdt/fdt_driver.h>
#ifdef CONFIG_FDT_SERIAL
-struct fdt_serial {
- const struct fdt_match *match_table;
- int (*init)(const void *fdt, int nodeoff, const struct fdt_match *match);
-};
-
int fdt_serial_init(const void *fdt);
#else