diff options
author | Andi Kleen <ak@suse.de> | 2007-02-13 07:26:26 -0500 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-02-13 07:26:26 -0500 |
commit | 62cc49396e593dd71c6595302bb10b085aefbfa5 (patch) | |
tree | a4487294b3ea5c6b4f90fb9b4fd46a64b852d450 /arch/i386 | |
parent | 40d22c1b5675e428b3f3f9a945d0bd62e94ca2f1 (diff) |
[PATCH] x86: Unify pcspeaker platform device code between i386/x86-64
Trivial cleanup.
Only change is that it is always compiled in now on x86-64 like on i386.
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/i386/kernel/pcspeaker.c | 20 | ||||
-rw-r--r-- | arch/i386/kernel/setup.c | 26 |
3 files changed, 21 insertions, 26 deletions
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile index 223969377de4..cbe4e601885c 100644 --- a/arch/i386/kernel/Makefile +++ b/arch/i386/kernel/Makefile | |||
@@ -42,6 +42,7 @@ obj-$(CONFIG_K8_NB) += k8.o | |||
42 | 42 | ||
43 | obj-$(CONFIG_VMI) += vmi.o vmitime.o | 43 | obj-$(CONFIG_VMI) += vmi.o vmitime.o |
44 | obj-$(CONFIG_PARAVIRT) += paravirt.o | 44 | obj-$(CONFIG_PARAVIRT) += paravirt.o |
45 | obj-y += pcspeaker.o | ||
45 | 46 | ||
46 | EXTRA_AFLAGS := -traditional | 47 | EXTRA_AFLAGS := -traditional |
47 | 48 | ||
diff --git a/arch/i386/kernel/pcspeaker.c b/arch/i386/kernel/pcspeaker.c new file mode 100644 index 000000000000..bc1f2d3ea277 --- /dev/null +++ b/arch/i386/kernel/pcspeaker.c | |||
@@ -0,0 +1,20 @@ | |||
1 | #include <linux/platform_device.h> | ||
2 | #include <linux/errno.h> | ||
3 | #include <linux/init.h> | ||
4 | |||
5 | static __init int add_pcspkr(void) | ||
6 | { | ||
7 | struct platform_device *pd; | ||
8 | int ret; | ||
9 | |||
10 | pd = platform_device_alloc("pcspkr", -1); | ||
11 | if (!pd) | ||
12 | return -ENOMEM; | ||
13 | |||
14 | ret = platform_device_add(pd); | ||
15 | if (ret) | ||
16 | platform_device_put(pd); | ||
17 | |||
18 | return ret; | ||
19 | } | ||
20 | device_initcall(add_pcspkr); | ||
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index bd8c218d94af..122623dcc6e1 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/initrd.h> | 33 | #include <linux/initrd.h> |
34 | #include <linux/bootmem.h> | 34 | #include <linux/bootmem.h> |
35 | #include <linux/seq_file.h> | 35 | #include <linux/seq_file.h> |
36 | #include <linux/platform_device.h> | ||
37 | #include <linux/console.h> | 36 | #include <linux/console.h> |
38 | #include <linux/mca.h> | 37 | #include <linux/mca.h> |
39 | #include <linux/root_dev.h> | 38 | #include <linux/root_dev.h> |
@@ -660,28 +659,3 @@ void __init setup_arch(char **cmdline_p) | |||
660 | #endif | 659 | #endif |
661 | tsc_init(); | 660 | tsc_init(); |
662 | } | 661 | } |
663 | |||
664 | static __init int add_pcspkr(void) | ||
665 | { | ||
666 | struct platform_device *pd; | ||
667 | int ret; | ||
668 | |||
669 | pd = platform_device_alloc("pcspkr", -1); | ||
670 | if (!pd) | ||
671 | return -ENOMEM; | ||
672 | |||
673 | ret = platform_device_add(pd); | ||
674 | if (ret) | ||
675 | platform_device_put(pd); | ||
676 | |||
677 | return ret; | ||
678 | } | ||
679 | device_initcall(add_pcspkr); | ||
680 | |||
681 | /* | ||
682 | * Local Variables: | ||
683 | * mode:c | ||
684 | * c-file-style:"k&r" | ||
685 | * c-basic-offset:8 | ||
686 | * End: | ||
687 | */ | ||