diff mbox

[U-Boot,v5,01/14] serial: Set up the 'priv' pointer when creating a serial device

Message ID 1409869656-29160-2-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Sept. 4, 2014, 10:27 p.m. UTC
The stdio_dev structure has a private pointer for its creator, but it is
not set up by the serial system. Set it to point to the serial device so
that it can be found by code called by stdio.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v5: None
Changes in v4: None
Changes in v3:
- Fix typo in commit message

Changes in v2: None

 drivers/serial/serial.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Simon Glass Sept. 21, 2014, 4:12 p.m. UTC | #1
On 4 September 2014 16:27, Simon Glass <sjg@chromium.org> wrote:
> The stdio_dev structure has a private pointer for its creator, but it is
> not set up by the serial system. Set it to point to the serial device so
> that it can be found by code called by stdio.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm/master and now in mainline.
diff mbox

Patch

diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
index d2eb752..bbe60af 100644
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
@@ -320,6 +320,7 @@  void serial_stdio_init(void)
 		dev.puts = serial_stub_puts;
 		dev.getc = serial_stub_getc;
 		dev.tstc = serial_stub_tstc;
+		dev.priv = s;
 
 		stdio_register(&dev);