]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] x86: Unify pcspeaker platform device code between i386/x86-64
authorAndi Kleen <ak@suse.de>
Tue, 13 Feb 2007 12:26:26 +0000 (13:26 +0100)
committerAndi Kleen <andi@basil.nowhere.org>
Tue, 13 Feb 2007 12:26:26 +0000 (13:26 +0100)
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>
arch/i386/kernel/Makefile
arch/i386/kernel/pcspeaker.c [new file with mode: 0644]
arch/i386/kernel/setup.c
arch/x86_64/kernel/Makefile
arch/x86_64/kernel/setup.c

index 223969377de43e690e4f1bc35375f3881c801f1a..cbe4e601885cecd18651d8e03880b9fbdf8b59ce 100644 (file)
@@ -42,6 +42,7 @@ obj-$(CONFIG_K8_NB)           += k8.o
 
 obj-$(CONFIG_VMI)              += vmi.o vmitime.o
 obj-$(CONFIG_PARAVIRT)         += paravirt.o
+obj-y                          += pcspeaker.o
 
 EXTRA_AFLAGS   := -traditional
 
diff --git a/arch/i386/kernel/pcspeaker.c b/arch/i386/kernel/pcspeaker.c
new file mode 100644 (file)
index 0000000..bc1f2d3
--- /dev/null
@@ -0,0 +1,20 @@
+#include <linux/platform_device.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+
+static __init int add_pcspkr(void)
+{
+       struct platform_device *pd;
+       int ret;
+
+       pd = platform_device_alloc("pcspkr", -1);
+       if (!pd)
+               return -ENOMEM;
+
+       ret = platform_device_add(pd);
+       if (ret)
+               platform_device_put(pd);
+
+       return ret;
+}
+device_initcall(add_pcspkr);
index bd8c218d94af5e1cdc6de06c4ce2fc29941e04b0..122623dcc6e1bc94543f0d343d0fe4a19e90cef7 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/initrd.h>
 #include <linux/bootmem.h>
 #include <linux/seq_file.h>
-#include <linux/platform_device.h>
 #include <linux/console.h>
 #include <linux/mca.h>
 #include <linux/root_dev.h>
@@ -660,28 +659,3 @@ void __init setup_arch(char **cmdline_p)
 #endif
        tsc_init();
 }
-
-static __init int add_pcspkr(void)
-{
-       struct platform_device *pd;
-       int ret;
-
-       pd = platform_device_alloc("pcspkr", -1);
-       if (!pd)
-               return -ENOMEM;
-
-       ret = platform_device_add(pd);
-       if (ret)
-               platform_device_put(pd);
-
-       return ret;
-}
-device_initcall(add_pcspkr);
-
-/*
- * Local Variables:
- * mode:c
- * c-file-style:"k&r"
- * c-basic-offset:8
- * End:
- */
index 3c7cbff04d3d78a2d8f5a73ecf8dbc1438475152..ae399458024bf9e1e20fa1d15328d2e2faa9ba36 100644 (file)
@@ -43,6 +43,7 @@ obj-$(CONFIG_PCI)             += early-quirks.o
 
 obj-y                          += topology.o
 obj-y                          += intel_cacheinfo.o
+obj-y                          += pcspeaker.o
 
 CFLAGS_vsyscall.o              := $(PROFILING) -g0
 
@@ -56,3 +57,4 @@ quirks-y                      += ../../i386/kernel/quirks.o
 i8237-y                                += ../../i386/kernel/i8237.o
 msr-$(subst m,y,$(CONFIG_X86_MSR))  += ../../i386/kernel/msr.o
 alternative-y                  += ../../i386/kernel/alternative.o
+pcspeaker-y                    += ../../i386/kernel/pcspeaker.o
index 13daaf359d217a9d2509f629211a4e92cbf6ccb9..3d98b696881d7b012b9a176fadb5b482e810786c 100644 (file)
@@ -1104,23 +1104,3 @@ struct seq_operations cpuinfo_op = {
        .stop = c_stop,
        .show = show_cpuinfo,
 };
-
-#if defined(CONFIG_INPUT_PCSPKR) || defined(CONFIG_INPUT_PCSPKR_MODULE)
-#include <linux/platform_device.h>
-static __init int add_pcspkr(void)
-{
-       struct platform_device *pd;
-       int ret;
-
-       pd = platform_device_alloc("pcspkr", -1);
-       if (!pd)
-               return -ENOMEM;
-
-       ret = platform_device_add(pd);
-       if (ret)
-               platform_device_put(pd);
-
-       return ret;
-}
-device_initcall(add_pcspkr);
-#endif