summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2008-01-29 10:14:57 +0000
committerRalf Baechle <ralf@linux-mips.org>2008-01-29 10:14:57 +0000
commit19388fb092d89e179575bd0b44f51b57e175edf5 (patch)
treed379d5657e85f026f57e1f193ab963b592a77711
parent0ab7aefc4d43a6dee26c891b41ef9c7a67d2379b (diff)
downloadop-kernel-dev-19388fb092d89e179575bd0b44f51b57e175edf5.zip
op-kernel-dev-19388fb092d89e179575bd0b44f51b57e175edf5.tar.gz
[MIPS] Cleanup pcspeaker platform device registration.
Move registration into the actual platform code instead of making a desparate attempt at sharing the hand full of likes of code in pcspeaker.c. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/Kconfig6
-rw-r--r--arch/mips/jazz/setup.c7
-rw-r--r--arch/mips/kernel/pcspeaker.c28
-rw-r--r--arch/mips/qemu/q-setup.c15
-rw-r--r--arch/mips/sni/pcit.c7
5 files changed, 29 insertions, 34 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index d5a89f3..8cbdfd2 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -132,7 +132,6 @@ config MACH_JAZZ
select I8253
select I8259
select ISA
- select PCSPEAKER
select SYS_HAS_CPU_R4X00
select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
@@ -378,7 +377,6 @@ config QEMU
select I8259
select IRQ_CPU
select ISA
- select PCSPEAKER
select SWAP_IO_SPACE
select SYS_HAS_CPU_MIPS32_R1
select SYS_HAS_EARLY_PRINTK
@@ -590,7 +588,6 @@ config SNI_RM
select I8253
select I8259
select ISA
- select PCSPEAKER
select SWAP_IO_SPACE if CPU_BIG_ENDIAN
select SYS_HAS_CPU_R4X00
select SYS_HAS_CPU_R5000
@@ -1995,9 +1992,6 @@ config MMU
config I8253
bool
-config PCSPEAKER
- bool
-
config ZONE_DMA32
bool
diff --git a/arch/mips/jazz/setup.c b/arch/mips/jazz/setup.c
index a785797..a794719 100644
--- a/arch/mips/jazz/setup.c
+++ b/arch/mips/jazz/setup.c
@@ -200,12 +200,19 @@ static struct platform_device jazz_cmos_pdev = {
.resource = jazz_cmos_rsrc
};
+static struct platform_device pcspeaker_pdev = {
+ .name = "pcspkr",
+ .id = -1,
+};
+
static int __init jazz_setup_devinit(void)
{
platform_device_register(&jazz_serial8250_device);
platform_device_register(&jazz_esp_pdev);
platform_device_register(&jazz_sonic_pdev);
platform_device_register(&jazz_cmos_pdev);
+ platform_device_register(&pcspeaker_pdev);
+
return 0;
}
diff --git a/arch/mips/kernel/pcspeaker.c b/arch/mips/kernel/pcspeaker.c
deleted file mode 100644
index 475df69..0000000
--- a/arch/mips/kernel/pcspeaker.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2006 IBM Corporation
- *
- * Implements device information for i8253 timer chip
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License version
- * 2 as published by the Free Software Foundation
- */
-
-#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);
diff --git a/arch/mips/qemu/q-setup.c b/arch/mips/qemu/q-setup.c
index 969cedc..9f0c2d3 100644
--- a/arch/mips/qemu/q-setup.c
+++ b/arch/mips/qemu/q-setup.c
@@ -1,4 +1,5 @@
#include <linux/init.h>
+#include <linux/platform_device.h>
#include <asm/i8253.h>
#include <asm/io.h>
@@ -20,3 +21,17 @@ void __init plat_mem_setup(void)
{
qemu_reboot_setup();
}
+
+static struct platform_device pcspeaker_pdev = {
+ .name = "pcspkr",
+ .id = -1,
+};
+
+static int __init qemu_platform_devinit(void)
+{
+ platform_device_register(&pcspeaker_pdev);
+
+ return 0;
+}
+
+device_initcall(qemu_platform_devinit);
diff --git a/arch/mips/sni/pcit.c b/arch/mips/sni/pcit.c
index 416f397..e5f12cf 100644
--- a/arch/mips/sni/pcit.c
+++ b/arch/mips/sni/pcit.c
@@ -76,6 +76,11 @@ static struct platform_device pcit_cmos_device = {
.resource = pcit_cmos_rsrc
};
+static struct platform_device pcit_pcspeaker_pdev = {
+ .name = "pcspkr",
+ .id = -1,
+};
+
static struct resource sni_io_resource = {
.start = 0x00000000UL,
.end = 0x03bfffffUL,
@@ -277,11 +282,13 @@ static int __init snirm_pcit_setup_devinit(void)
case SNI_BRD_PCI_TOWER:
platform_device_register(&pcit_serial8250_device);
platform_device_register(&pcit_cmos_device);
+ platform_device_register(&pcit_pcspeaker_pdev);
break;
case SNI_BRD_PCI_TOWER_CPLUS:
platform_device_register(&pcit_cplus_serial8250_device);
platform_device_register(&pcit_cmos_device);
+ platform_device_register(&pcit_pcspeaker_pdev);
break;
}
return 0;
OpenPOWER on IntegriCloud