From addf9513d0b1a57062a8604330e8c0e822d9d214 Mon Sep 17 00:00:00 2001
From: Simon Glass <sjg@chromium.org>
Date: Thu, 4 Sep 2014 16:27:23 -0600
Subject: [PATCH] serial: Set up the 'priv' pointer when creating a serial
 device

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>
---
 drivers/serial/serial.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
index d2eb7520d0..bbe60af627 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);
 
-- 
2.39.5