BUG_ON() won't work in the early init code, so replace it with
a new routine udbg_panic() that uses udbg_printf() and lv1_panic().

Signed-off-by: Geoff Levand <ge...@infradead.org>
---
 arch/powerpc/platforms/ps3/mm.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index 423be34f0f5f..7c7c2f53eacb 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -26,6 +26,13 @@
 #define DBG pr_devel
 #endif
 
+#define udbg_panic(_val, _msg) \
+if (_val) { \
+       udbg_printf("%s:%d: " _msg ": %d\n", \
+               __func__, __LINE__, (int)(_val)); \
+       lv1_panic(0); \
+}
+
 enum {
 #if defined(CONFIG_PS3_DYNAMIC_DMA)
        USE_DYNAMIC_DMA = 1,
@@ -313,7 +320,7 @@ static void ps3_mm_region_destroy(struct mem_region *r)
 
        if (r->base) {
                result = lv1_release_memory(r->base);
-               BUG_ON(result);
+               udbg_panic(result, "lv1_release_memory failed");
                r->size = r->base = r->offset = 0;
                map.total = map.rm.size;
        }
-- 
2.20.1

Reply via email to