LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 3/5] KGDB-8250: respect early parameters
@ 2008-01-29 23:45 Jan Kiszka
  0 siblings, 0 replies; only message in thread
From: Jan Kiszka @ 2008-01-29 23:45 UTC (permalink / raw)
  To: Jason Wessel; +Cc: Ingo Molnar, Linux Kernel Mailing List, kgdb-bugreport

This patch makes sure that the config string passed via "kgdb8250="
takes precedence over any built-time configuration.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>

---
 drivers/serial/8250_kgdb.c |   29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

Index: b/drivers/serial/8250_kgdb.c
===================================================================
--- a/drivers/serial/8250_kgdb.c
+++ b/drivers/serial/8250_kgdb.c
@@ -39,7 +39,9 @@ module_param_string(kgdb8250, config, 25
 MODULE_PARM_DESC(kgdb8250,
 		 " kgdb8250=<io or mmio>,<address>,<baud rate>,<irq>\n");
 static struct kgdb_io local_kgdb_io_ops;
-#endif				/* CONFIG_KGDB_8250_MODULE */
+#else  /* !CONFIG_KGDB_8250_MODULE */
+static int params_evaluated;
+#endif /* !CONFIG_KGDB_8250_MODULE */

 /* Speed of the UART. */
 static int kgdb8250_baud;
@@ -320,16 +322,17 @@ static __init int kgdb_init_io(void)
 		       "kgdb8250=<line #>,<baud rate>\n");
 		return -EINVAL;
 	}
-#elif defined(CONFIG_KGDB_SIMPLE_SERIAL)
-	kgdb8250_baud = CONFIG_KGDB_BAUDRATE;
-
-	/* Setup our pointer to the serial port now. */
-	current_port = &kgdb8250_ports[CONFIG_KGDB_PORT_NUM];
-#else
-	if (kgdb8250_opt(CONFIG_KGDB_8250_CONF_STRING))
-		return -EINVAL;
-#endif
-
+#else  /* !CONFIG_KGDB_8250_MODULE */
+	if (!params_evaluated) {
+#ifdef CONFIG_KGDB_SIMPLE_SERIAL
+		kgdb8250_baud = CONFIG_KGDB_BAUDRATE;
+		current_port = &kgdb8250_ports[CONFIG_KGDB_PORT_NUM];
+#else /* !CONFIG_KGDB_SIMPLE_SERIAL */
+		if (kgdb8250_opt(CONFIG_KGDB_8250_CONF_STRING))
+			return -EINVAL;
+#endif /* !CONFIG_KGDB_SIMPLE_SERIAL */
+	}
+#endif /* !CONFIG_KGDB_8250_MODULE */

 	/* Internal driver setup. */
 	switch (current_port->iotype) {
@@ -512,7 +515,9 @@ finish:
 #ifdef CONFIG_KGDB_SIMPLE_SERIAL
 	should_copy_rs_table = 0;
 #endif
-
+#ifdef CONFIG_KGDB_8250
+	params_evaluated = 1;
+#endif
 	return 0;

 errout:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-01-29 23:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-29 23:45 [PATCH 3/5] KGDB-8250: respect early parameters Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).