Decompression errors without DEBUG_LL shouldn't result in a silent hang
when CONFIG_PBL_CONSOLE is enabled.

Signed-off-by: Ahmad Fatoum <[email protected]>
---
 include/pbl.h | 5 +++++
 pbl/decomp.c  | 8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/include/pbl.h b/include/pbl.h
index b330010562c4..063cd15cf0ea 100644
--- a/include/pbl.h
+++ b/include/pbl.h
@@ -34,5 +34,10 @@ int pbl_barebox_verify(const void *compressed_start, 
unsigned int len,
 
 void __noreturn barebox_pbl_entry(ulong, ulong, void *);
 
+#ifdef CONFIG_PBL_CONSOLE
+#define pbl_puts       puts
+#else
+#define pbl_puts       puts_ll
+#endif
 
 #endif /* __PBL_H__ */
diff --git a/pbl/decomp.c b/pbl/decomp.c
index ebdf81ddfbe5..c314f4901a48 100644
--- a/pbl/decomp.c
+++ b/pbl/decomp.c
@@ -45,10 +45,10 @@ STATIC int decompress(u8 *input, int in_len,
 
 static void noinline errorfn(char *error)
 {
-       puts_ll("ERROR: ");
-       puts_ll(error);
-       puts_ll("\nHANG\n");
-       while (1);
+       pbl_puts("ERROR: ");
+       pbl_puts(error);
+       pbl_puts("\nHANG\n");
+       __hang();
 }
 
 extern unsigned char sha_sum[];
-- 
2.47.3


Reply via email to