mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Paul Mackerras <paulus@samba.org>
Cc: vojtech@suse.cz, linux-kernel@vger.kernel.org, mikey@neuling.org
Subject: Re: [PATCH] Allow arch to veto PC speaker beeper initialization
Date: Mon, 14 Nov 2005 19:55:32 -0800	[thread overview]
Message-ID: <20051114195532.3500080b.akpm@osdl.org> (raw)
In-Reply-To: <17273.16792.850639.195427@cargo.ozlabs.ibm.com>

Paul Mackerras <paulus@samba.org> wrote:
>
> Index: linux-2.6/drivers/input/misc/pcspkr.c
> ===================================================================
> --- linux-2.6.orig/drivers/input/misc/pcspkr.c	2005-10-31 15:16:39.000000000 +1100
> +++ linux-2.6/drivers/input/misc/pcspkr.c	2005-10-31 15:21:13.000000000 +1100
> @@ -66,6 +66,11 @@
>  
>  static int __init pcspkr_init(void)
>  {
> +#ifdef HAS_PCSPKR_ARCH_INIT
> +	int rc = pcspkr_arch_init();
> +	if (rc)
> +		return rc;
> +#endif
>  	pcspkr_dev = input_allocate_device();
>  	if (!pcspkr_dev)
>  		return -ENOMEM;
> Index: linux-2.6/include/asm-powerpc/8253pit.h
> ===================================================================
> --- linux-2.6.orig/include/asm-powerpc/8253pit.h	2005-10-31 15:02:18.000000000 +1100
> +++ linux-2.6/include/asm-powerpc/8253pit.h	2005-10-31 15:20:30.000000000 +1100
> @@ -5,6 +5,19 @@
>   * 8253/8254 Programmable Interval Timer
>   */
>  
> +#include <asm/prom.h>
> +
>  #define PIT_TICK_RATE	1193182UL
>  
> +#define HAS_PCSPKR_ARCH_INIT
> +
> +static inline int pcspkr_arch_init(void)
> +{
> +	struct device_node *np;
> +
> +	np = of_find_compatible_node(NULL, NULL, "pnpPNP,100");
> +	of_node_put(np);
> +	return np ? 0 : -ENODEV;
> +}
> +
>  #endif	/* _ASM_POWERPC_8253PIT_H */

We can avoid all the ifdef nasties by adding

static int pcspkr_arch_init(void) __attribute__((weak))
{
	return 0;
}

in pcspkr.c.

It'll bloat the kernel by a few bytes.

  reply	other threads:[~2005-11-15  3:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-15  2:02 Paul Mackerras
2005-11-15  3:55 ` Andrew Morton [this message]
2005-11-15  4:00   ` Paul Mackerras
2005-11-15  9:08 ` Christoph Hellwig

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=20051114195532.3500080b.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikey@neuling.org \
    --cc=paulus@samba.org \
    --cc=vojtech@suse.cz \
    /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

all inboxes | Powered by JetHome®