[PATCH] param: console: Do not treat console as synonym for earlycon

From: Sascha Hauer
Date: Fri May 08 2015 - 02:23:47 EST


Since 2007 console= and earlycon= are treated as synonyms, but the
syntax for both options is different. The only case in which they
are identical is for console=uart or console=uart8250. All other
cases currently lead to the warning:

earlycon: no match for xxx

This patch drops the general aliasing, but keeps the current
behaviour for console=uart and console=uart8250 to keep the kernel
parameters compatible.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
init/main.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/init/main.c b/init/main.c
index 2115055..bfcbbc5 100644
--- a/init/main.c
+++ b/init/main.c
@@ -413,12 +413,15 @@ static noinline void __init_refok rest_init(void)
static int __init do_early_param(char *param, char *val, const char *unused)
{
const struct obs_kernel_param *p;
+ bool earlyconalias = false;
+
+ if (val && !strcmp(param, "console") &&
+ (!strncmp(val, "uart,", 5) || !strncmp(val, "uart8250,", 9)))
+ earlyconalias = true;

for (p = __setup_start; p < __setup_end; p++) {
if ((p->early && parameq(param, p->str)) ||
- (strcmp(param, "console") == 0 &&
- strcmp(p->str, "earlycon") == 0)
- ) {
+ (earlyconalias && strcmp(p->str, "earlycon") == 0)) {
if (p->setup_func(val) != 0)
pr_warn("Malformed early option '%s'\n", param);
}
--
2.1.4

--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/