early_printk: consolidate random copies of identical code
The early console implementations are the same all over the place. Move
the print function to kernel/printk and get rid of the copies.
[v3: drop sparc bits as suggested by tglx, redo build tests on sparc
sparc32, Randy's randconfig, ppc, mips, arm...]
[v2: essentially unchanged since v1, so I've left the acked/reviewed
tags. There was a compile fail[1] for a randconfig with EARLY_PRINTK=y
and PRINTK=n, because the early_console struct and early_printk calls
were nested within an #ifdef CONFIG_PRINTK -- moving that whole block
exactly as-is to be outside the #ifdef CONFIG_PRINTK fixes the randconfig
and still works for everyday sane configs too.]
[1] http://marc.info/?l=linux-next&m=
136219350914998&w=2
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Russell King <linux@arm.linux.org.uk>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Richard Weinberger <richard@nod.at>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>