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>
This commit is contained in:
Samuel Holland
2024-11-11 14:02:54 -08:00
committed by Anup Patel
parent 6d9ad492db
commit a524f0a507
12 changed files with 18 additions and 60 deletions

View File

@@ -25,7 +25,7 @@ static const struct fdt_match serial_renesas_scif_match[] = {
{ /* sentinel */ }
};
struct fdt_serial fdt_serial_renesas_scif = {
const struct fdt_driver fdt_serial_renesas_scif = {
.match_table = serial_renesas_scif_match,
.init = serial_renesas_scif_init
};