linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: <linuxppc-dev@ozlabs.org>
Subject: [PATCH 2/4] powerpc: Add ppc_progress() wrapper
Date: Thu, 15 Jan 2009 17:43:17 +1100 (EST)	[thread overview]
Message-ID: <3922453a668745466cb291f889d2c067932e4894.1232001793.git.michael@ellerman.id.au> (raw)
In-Reply-To: <e3520e2f9806d4f6e4b30587b6d29176e583833d.1232001793.git.michael@ellerman.id.au>

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 <michael@ellerman.id.au>
---
 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 : "");
+}
-- 
1.5.5

  reply	other threads:[~2009-01-15  6:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15  6:43 [PATCH 1/4] powerpc: Remove unused ppc64_terminate_msg() Michael Ellerman
2009-01-15  6:43 ` Michael Ellerman [this message]
2009-01-15  7:23   ` [PATCH 2/4] powerpc: Add ppc_progress() wrapper Grant Likely
2009-01-15 11:34   ` Paul Mackerras
2009-01-15 23:01     ` Benjamin Herrenschmidt
2009-01-15 23:09     ` Michael Ellerman
2009-01-15  6:43 ` [PATCH 3/4] powerpc: Replace ppc_md.progress() uses with ppc_progress() Michael Ellerman
2009-01-15  7:25   ` Grant Likely
2009-01-15  6:43 ` [PATCH 4/4] powerpc: Remove printk-only progress implementations Michael Ellerman
2009-01-15  7:26   ` Grant Likely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3922453a668745466cb291f889d2c067932e4894.1232001793.git.michael@ellerman.id.au \
    --to=michael@ellerman.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).