From e3e2470fdd57567e8df04e76203cd4e580a93975 Mon Sep 17 00:00:00 2001 From: Walter Lozano Date: Thu, 25 Jun 2020 01:10:04 -0300 Subject: drivers: rename drivers to match compatible string When using OF_PLATDATA, the bind process between devices and drivers is performed trying to match compatible string with driver names. However driver names are not strictly defined, and also there are different names used when declaring a driver with U_BOOT_DRIVER, the name of the symbol used in the linker list and the used in the struct driver_info. In order to make things a bit more clear, rename the drivers names. This will also help for further OF_PLATDATA improvements, such as checking for valid driver names. Signed-off-by: Walter Lozano Reviewed-by: Simon Glass Add a fix for sandbox of-platdata to avoid using an invalid ANSI colour: Signed-off-by: Simon Glass --- drivers/serial/sandbox.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/serial') diff --git a/drivers/serial/sandbox.c b/drivers/serial/sandbox.c index 545ff3f747..f09d291e04 100644 --- a/drivers/serial/sandbox.c +++ b/drivers/serial/sandbox.c @@ -93,7 +93,9 @@ static int sandbox_serial_putc(struct udevice *dev, const char ch) struct sandbox_serial_priv *priv = dev_get_priv(dev); struct sandbox_serial_platdata *plat = dev->platdata; - if (priv->start_of_line && plat->colour != -1) { + /* With of-platdata we don't real the colour correctly, so disable it */ + if (!CONFIG_IS_ENABLED(OF_PLATDATA) && priv->start_of_line && + plat->colour != -1) { priv->start_of_line = false; output_ansi_colour(plat->colour); } @@ -252,8 +254,8 @@ static const struct udevice_id sandbox_serial_ids[] = { { } }; -U_BOOT_DRIVER(serial_sandbox) = { - .name = "serial_sandbox", +U_BOOT_DRIVER(sandbox_serial) = { + .name = "sandbox_serial", .id = UCLASS_SERIAL, .of_match = sandbox_serial_ids, .ofdata_to_platdata = sandbox_serial_ofdata_to_platdata, @@ -270,7 +272,7 @@ static const struct sandbox_serial_platdata platdata_non_fdt = { }; U_BOOT_DEVICE(serial_sandbox_non_fdt) = { - .name = "serial_sandbox", + .name = "sandbox_serial", .platdata = &platdata_non_fdt, }; #endif /* CONFIG_IS_ENABLED(OF_CONTROL) */ -- cgit v1.2.3