Thread (5 messages) 5 messages, 3 authors, 2021-11-15
STALE1685d

[PATCH] serial: liteuart: fix missing drvdata

From: Ilia Sergachev <hidden>
Date: 2021-11-15 02:34:12
Subsystem: litex platform, the rest, tty layer and serial drivers · Maintainers: Karol Gugala, Mateusz Holenko, Gabriel Somlo, Joel Stanley, Linus Torvalds, Greg Kroah-Hartman, Jiri Slaby

drvdata has to be set in _probe() - otherwise platform_get_drvdata()
causes null pointer dereference BUG in _remove()

Signed-off-by: Ilia Sergachev <redacted>
---
 drivers/tty/serial/liteuart.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c
index dbc0559a9157..f075f4ff5fcf 100644
--- a/drivers/tty/serial/liteuart.c
+++ b/drivers/tty/serial/liteuart.c
@@ -285,6 +285,8 @@ static int liteuart_probe(struct platform_device *pdev)
 	port->line = dev_id;
 	spin_lock_init(&port->lock);
 
+	platform_set_drvdata(pdev, port);
+
 	return uart_add_one_port(&liteuart_driver, &uart->port);
 }
 
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help