diff mbox

[RFC,03/12] ARM: Add indirection around arch_decomp_setup()/arch_error()

Message ID 20120715024608.900969405@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Domenico Andreoli July 15, 2012, 2:44 a.m. UTC
From: Domenico Andreoli <domenico.andreoli@linux.com>

Adding an indirection level to call the legacy functions
arch_decomp_setup() and arch_error() defined in the various
mach/uncompress.h headers.

These so called fallback functions will be used in case no other option
is available to get a better console for the decompressor. This is the
case of boards not using the new interface introduced by this patch
(we don't want to break existing code).

Side note: multiplatform kernels will receive nice empty stubs as
fallbacks so that if no console is selected none is used.

Signed-off-by: Domenico Andreoli <domenico.andreoli@linux.com>

---
 arch/arm/boot/compressed/misc.c |   40 +++++++++++++++++++++++++++++++++-------
 1 file changed, 33 insertions(+), 7 deletions(-)
diff mbox

Patch

Index: b/arch/arm/boot/compressed/misc.c
===================================================================
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -23,9 +23,11 @@  unsigned int __machine_arch_type;
 #include <linux/linkage.h>
 
 static void putstr(const char *ptr);
-extern void error(char *x);
+void error(char *x);
 
+#ifndef CONFIG_ARCH_MULTIPLATFORM
 #include <mach/uncompress.h>
+#endif
 
 #ifdef CONFIG_DEBUG_ICEDCC
 
@@ -83,6 +85,34 @@  static void icedcc_putc(int ch)
 #define putc(ch)	icedcc_putc(ch)
 #endif
 
+#ifdef CONFIG_ARCH_MULTIPLATFORM
+
+void fallback_arch_setup(void)
+{
+}
+
+void fallback_arch_error(char *x)
+{
+}
+
+#else
+
+#ifndef arch_error
+#define arch_error(x)
+#endif
+
+void fallback_arch_setup(void)
+{
+	arch_decomp_setup();
+}
+
+void fallback_arch_error(char *x)
+{
+	arch_error(x);
+}
+
+#endif /* CONFIG_ARCH_MULTIPLATFORM */
+
 static void putstr(const char *ptr)
 {
 	char c;
@@ -107,13 +137,9 @@  unsigned char *output_data;
 unsigned long free_mem_ptr;
 unsigned long free_mem_end_ptr;
 
-#ifndef arch_error
-#define arch_error(x)
-#endif
-
 void error(char *x)
 {
-	arch_error(x);
+	fallback_arch_error(x);
 
 	putstr("\n\n");
 	putstr(x);
@@ -142,7 +168,7 @@  decompress_kernel(unsigned long output_s
 	free_mem_end_ptr	= free_mem_ptr_end_p;
 	__machine_arch_type	= arch_id;
 
-	arch_decomp_setup();
+	fallback_arch_setup();
 
 	putstr("Uncompressing Linux...");
 	ret = do_decompress(input_data, input_data_end - input_data,