[PATCH v2 1/3] drivers: serial: earlycon: Correct argument name
Markuss Broks
markuss.broks at gmail.com
Sat Aug 6 16:32:22 UTC 2022
The "node" argument is actually an offset, and it's also
an "int", and not "unsigned long". Correct the of_setup_earlycon
function.
Signed-off-by: Markuss Broks <markuss.broks at gmail.com>
---
drivers/tty/serial/earlycon.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 57c70851f22a0e78805f34d1a7700708104b6f6a..bc210ae8173d97d5ef422468acf2755a853cb943 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -244,7 +244,7 @@ early_param("earlycon", param_setup_earlycon);
#ifdef CONFIG_OF_EARLY_FLATTREE
int __init of_setup_earlycon(const struct earlycon_id *match,
- unsigned long node,
+ int offset,
const char *options)
{
int err;
@@ -255,25 +255,25 @@ int __init of_setup_earlycon(const struct earlycon_id *match,
spin_lock_init(&port->lock);
port->iotype = UPIO_MEM;
- addr = of_flat_dt_translate_address(node);
+ addr = of_flat_dt_translate_address(offset);
if (addr == OF_BAD_ADDR) {
pr_warn("[%s] bad address\n", match->name);
return -ENXIO;
}
port->mapbase = addr;
- val = of_get_flat_dt_prop(node, "reg-offset", NULL);
+ val = of_get_flat_dt_prop(offset, "reg-offset", NULL);
if (val)
port->mapbase += be32_to_cpu(*val);
port->membase = earlycon_map(port->mapbase, SZ_4K);
- val = of_get_flat_dt_prop(node, "reg-shift", NULL);
+ val = of_get_flat_dt_prop(offset, "reg-shift", NULL);
if (val)
port->regshift = be32_to_cpu(*val);
- big_endian = of_get_flat_dt_prop(node, "big-endian", NULL) != NULL ||
+ big_endian = of_get_flat_dt_prop(offset, "big-endian", NULL) != NULL ||
(IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) &&
- of_get_flat_dt_prop(node, "native-endian", NULL) != NULL);
- val = of_get_flat_dt_prop(node, "reg-io-width", NULL);
+ of_get_flat_dt_prop(offset, "native-endian", NULL) != NULL);
+ val = of_get_flat_dt_prop(offset, "reg-io-width", NULL);
if (val) {
switch (be32_to_cpu(*val)) {
case 1:
@@ -291,11 +291,11 @@ int __init of_setup_earlycon(const struct earlycon_id *match,
}
}
- val = of_get_flat_dt_prop(node, "current-speed", NULL);
+ val = of_get_flat_dt_prop(offset, "current-speed", NULL);
if (val)
early_console_dev.baud = be32_to_cpu(*val);
- val = of_get_flat_dt_prop(node, "clock-frequency", NULL);
+ val = of_get_flat_dt_prop(offset, "clock-frequency", NULL);
if (val)
port->uartclk = be32_to_cpu(*val);
--
2.37.0
More information about the dri-devel
mailing list