So we can be sure the console is only available when IP & Port are set.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
---
 net/netconsole.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/net/netconsole.c b/net/netconsole.c
index 2ab19de..f6e9701 100644
--- a/net/netconsole.c
+++ b/net/netconsole.c
@@ -129,6 +129,14 @@ static int nc_port_set(struct param_d *p, void *_priv)
        return 0;
 }
 
+static int nc_is_ready(struct console_device *cdev)
+{
+       struct nc_priv *priv = container_of(cdev,
+                                       struct nc_priv, cdev);
+
+       return priv->ip && priv->port;
+}
+
 static int netconsole_init(void)
 {
        struct nc_priv *priv;
@@ -140,6 +148,7 @@ static int netconsole_init(void)
        cdev->tstc = nc_tstc;
        cdev->putc = nc_putc;
        cdev->getc = nc_getc;
+       cdev->is_ready = nc_is_ready;
 
        g_priv = priv;
 
-- 
1.8.4.3


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to