diff options
author | Michael Neuling <mikey@neuling.org> | 2006-03-14 00:11:50 -0500 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-03-14 00:11:50 -0500 |
commit | e5c6c8e457d16c7cbc12f849ad18d4d508950de2 (patch) | |
tree | 25a6342ef5fa5ae19f1fbaed8538290225dba38d /arch/i386/kernel/setup.c | |
parent | aaef685d5726768d25cbdc672a59c284d820b82e (diff) |
Input: pcspkr - separate device and driver registration
The current pcspkr code combines the device and driver registration.
This patch splits these, putting the device registration in the arch
specific code.
PowerPC and MIPS only have the pcspkr present sometimes.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'arch/i386/kernel/setup.c')
-rw-r--r-- | arch/i386/kernel/setup.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index ab62a9f4701e..a0b407585679 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/initrd.h> | 34 | #include <linux/initrd.h> |
35 | #include <linux/bootmem.h> | 35 | #include <linux/bootmem.h> |
36 | #include <linux/seq_file.h> | 36 | #include <linux/seq_file.h> |
37 | #include <linux/platform_device.h> | ||
37 | #include <linux/console.h> | 38 | #include <linux/console.h> |
38 | #include <linux/mca.h> | 39 | #include <linux/mca.h> |
39 | #include <linux/root_dev.h> | 40 | #include <linux/root_dev.h> |
@@ -1634,6 +1635,23 @@ void __init setup_arch(char **cmdline_p) | |||
1634 | #endif | 1635 | #endif |
1635 | } | 1636 | } |
1636 | 1637 | ||
1638 | static __init int add_pcspkr(void) | ||
1639 | { | ||
1640 | struct platform_device *pd; | ||
1641 | int ret; | ||
1642 | |||
1643 | pd = platform_device_alloc("pcspkr", -1); | ||
1644 | if (!pd) | ||
1645 | return -ENOMEM; | ||
1646 | |||
1647 | ret = platform_device_add(pd); | ||
1648 | if (ret) | ||
1649 | platform_device_put(pd); | ||
1650 | |||
1651 | return ret; | ||
1652 | } | ||
1653 | device_initcall(add_pcspkr); | ||
1654 | |||
1637 | #include "setup_arch_post.h" | 1655 | #include "setup_arch_post.h" |
1638 | /* | 1656 | /* |
1639 | * Local Variables: | 1657 | * Local Variables: |