From patchwork Thu Jan 15 06:43:17 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 18582 X-Patchwork-Delegate: benh@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 95236DE31B for ; Thu, 15 Jan 2009 17:46:34 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: by ozlabs.org (Postfix, from userid 1034) id A346EDE242; Thu, 15 Jan 2009 17:43:17 +1100 (EST) To: Message-Id: <3922453a668745466cb291f889d2c067932e4894.1232001793.git.michael@ellerman.id.au> In-Reply-To: References: From: Michael Ellerman Subject: [PATCH 2/4] powerpc: Add ppc_progress() wrapper Date: Thu, 15 Jan 2009 17:43:17 +1100 (EST) X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org There's quite a lot of code that does: if (ppc_md.progress) ppc_md.progress(...) So move that idiom into a wrapper. Having a wrapper also allows us to have a fallback to printk if no progress routine is specified. Signed-off-by: Michael Ellerman Acked-by: Grant Likely --- arch/powerpc/include/asm/machdep.h | 2 ++ arch/powerpc/kernel/setup-common.c | 8 ++++++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 6c34a0d..9e4ab07 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h @@ -328,6 +328,8 @@ extern void __devinit smp_generic_take_timebase(void); /* Print a boot progress message. */ void ppc64_boot_msg(unsigned int src, const char *msg); +extern void ppc_progress(char *msg, unsigned short code); + static inline void log_error(char *buf, unsigned int err_type, int fatal) { if (ppc_md.log_error) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 705fc4b..cc4997b 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -669,3 +669,11 @@ static int powerpc_debugfs_init(void) } arch_initcall(powerpc_debugfs_init); #endif + +void ppc_progress(char *msg, unsigned short code) +{ + if (ppc_md.progress) + ppc_md.progress(msg, code); + else + printk(KERN_DEBUG "*** %04x : %s\n", code, msg ? msg : ""); +}