Skip to contentSkip to conversation

serial: mcfuart: fix uart port index

PATCH New Angelo Dureghello 2 participants 2 messages Feb 29, 2020 – Mar 13, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: mcfuart: fix uart port index

From: Angelo Durgehello <[email protected]>

Actually, using dev->seq value before probe to deduce the current serial port index leads to reading an invalid seq value (-1). So, getting dev->seq at probe time.

---
 drivers/serial/mcfuart.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/serial/mcfuart.c +2 -2
index 066e5a18d8..b599064b48 100644
@@ -85,6 +85,8 @@ static int coldfire_serial_probe(struct udevice *dev)
 {
 	struct coldfire_serial_platdata *plat = dev->platdata;
 
+	plat->port = dev->seq;
+
 	return mcf_serial_init_common((uart_t *)plat->base,
 						plat->port, plat->baudrate);
 }
@@ -148,8 +150,6 @@ static int coldfire_ofdata_to_platdata(struct udevice *dev)
 		return -ENODEV;
 
 	plat->base = (uint32_t)addr_base;
-
-	plat->port = dev->seq;
 	plat->baudrate = gd->baudrate;
 
 	return 0;
Signature · 1 line
2.25.0
#1 lore raw

PATCH 1/1 serial: mcfuart: fix uart port index

Quoted 7 lines · Angelo Dureghello

From: Angelo Durgehello <[email protected]>

Actually, using dev->seq value before probe to deduce the current serial port index leads to reading an invalid seq value (-1). So, getting dev->seq at probe time.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200313/b0104a13/attachment.sig>