[PATCH 2/4] powerpc: Add ppc_progress() wrapper

Grant Likely grant.likely at secretlab.ca
Thu Jan 15 18:23:54 EST 2009


On Wed, Jan 14, 2009 at 11:43 PM, Michael Ellerman
<michael at ellerman.id.au> wrote:
> 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 at ellerman.id.au>

Good idea.

Acked-by: Grant Likely <grant.likely at secretlab.ca>

> ---
>  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
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev at ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.



More information about the Linuxppc-dev mailing list