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 | |
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')
-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 | ||||
-rw-r--r-- | arch/x86_64/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/x86_64/kernel/setup.c | 20 |
5 files changed, 23 insertions, 46 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 | */ | ||
diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile index 3c7cbff04d3d..ae399458024b 100644 --- a/arch/x86_64/kernel/Makefile +++ b/arch/x86_64/kernel/Makefile | |||
@@ -43,6 +43,7 @@ obj-$(CONFIG_PCI) += early-quirks.o | |||
43 | 43 | ||
44 | obj-y += topology.o | 44 | obj-y += topology.o |
45 | obj-y += intel_cacheinfo.o | 45 | obj-y += intel_cacheinfo.o |
46 | obj-y += pcspeaker.o | ||
46 | 47 | ||
47 | CFLAGS_vsyscall.o := $(PROFILING) -g0 | 48 | CFLAGS_vsyscall.o := $(PROFILING) -g0 |
48 | 49 | ||
@@ -56,3 +57,4 @@ quirks-y += ../../i386/kernel/quirks.o | |||
56 | i8237-y += ../../i386/kernel/i8237.o | 57 | i8237-y += ../../i386/kernel/i8237.o |
57 | msr-$(subst m,y,$(CONFIG_X86_MSR)) += ../../i386/kernel/msr.o | 58 | msr-$(subst m,y,$(CONFIG_X86_MSR)) += ../../i386/kernel/msr.o |
58 | alternative-y += ../../i386/kernel/alternative.o | 59 | alternative-y += ../../i386/kernel/alternative.o |
60 | pcspeaker-y += ../../i386/kernel/pcspeaker.o | ||
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index 13daaf359d21..3d98b696881d 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c | |||
@@ -1104,23 +1104,3 @@ struct seq_operations cpuinfo_op = { | |||
1104 | .stop = c_stop, | 1104 | .stop = c_stop, |
1105 | .show = show_cpuinfo, | 1105 | .show = show_cpuinfo, |
1106 | }; | 1106 | }; |
1107 | |||
1108 | #if defined(CONFIG_INPUT_PCSPKR) || defined(CONFIG_INPUT_PCSPKR_MODULE) | ||
1109 | #include <linux/platform_device.h> | ||
1110 | static __init int add_pcspkr(void) | ||
1111 | { | ||
1112 | struct platform_device *pd; | ||
1113 | int ret; | ||
1114 | |||
1115 | pd = platform_device_alloc("pcspkr", -1); | ||
1116 | if (!pd) | ||
1117 | return -ENOMEM; | ||
1118 | |||
1119 | ret = platform_device_add(pd); | ||
1120 | if (ret) | ||
1121 | platform_device_put(pd); | ||
1122 | |||
1123 | return ret; | ||
1124 | } | ||
1125 | device_initcall(add_pcspkr); | ||
1126 | #endif | ||