All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Jason Wessel <jason.wessel@windriver.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	kgdb-bugreport@lists.sourceforge.net
Subject: [PATCH 3/5] KGDB-8250: respect early parameters
Date: Wed, 30 Jan 2008 00:45:23 +0100	[thread overview]
Message-ID: <479FBA93.5080904@web.de> (raw)

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:

                 reply	other threads:[~2008-01-29 23:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=479FBA93.5080904@web.de \
    --to=jan.kiszka@web.de \
    --cc=jason.wessel@windriver.com \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.