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
        select I8259
        select IRQ_CPU
        select ISA
-       select PCSPEAKER
        select SWAP_IO_SPACE
        select SYS_HAS_CPU_MIPS32_R1
        select SYS_HAS_EARLY_PRINTK
        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
 config I8253
        bool
 
-config PCSPEAKER
-       bool
-
 config ZONE_DMA32
        bool
 
 
        .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;
 }
 
 
+++ /dev/null
-/*
- * 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);
 
 #include <linux/init.h>
+#include <linux/platform_device.h>
 
 #include <asm/i8253.h>
 #include <asm/io.h>
 {
        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);
 
         .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,
        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;