[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>
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 @@
{
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);