From patchwork Tue Mar 13 12:19:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 146403 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 74221B6EEC for ; Wed, 14 Mar 2012 00:23:54 +1100 (EST) Received: from localhost ([::1]:52696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7QjJ-00010n-Ca for incoming@patchwork.ozlabs.org; Tue, 13 Mar 2012 08:21:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7Qib-0007Yp-J7 for qemu-devel@nongnu.org; Tue, 13 Mar 2012 08:20:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7Qi8-0000vh-Hv for qemu-devel@nongnu.org; Tue, 13 Mar 2012 08:20:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62739) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7Qi8-0000ux-9e for qemu-devel@nongnu.org; Tue, 13 Mar 2012 08:20:16 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2DCKEk2005713 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 13 Mar 2012 08:20:14 -0400 Received: from rincewind.home.kraxel.org (ovpn-116-19.ams2.redhat.com [10.36.116.19]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q2DCKCbO000851; Tue, 13 Mar 2012 08:20:13 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 1F219417E9; Tue, 13 Mar 2012 13:20:11 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 13 Mar 2012 13:19:59 +0100 Message-Id: <1331641211-20077-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1331641211-20077-1-git-send-email-kraxel@redhat.com> References: <1331641211-20077-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 02/14] usb: zap hw/ush-{ohic, uhci}.h + init wrappers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Remove the uhci and ohci init wrappers, which all wrapped a pci_create_simple() one-liner. Switch callsites to call pci_create_simple directly. Remove the header files where the wrappers where declared. Signed-off-by: Gerd Hoffmann --- hw/alpha_sys.h | 1 - hw/mips_fulong2e.c | 7 ++++--- hw/mips_malta.c | 3 +-- hw/pc_piix.c | 4 +--- hw/ppc_newworld.c | 3 +-- hw/ppc_oldworld.c | 3 +-- hw/ppc_prep.c | 3 +-- hw/realview.c | 3 +-- hw/usb-ohci.h | 9 --------- hw/usb-uhci.h | 10 ---------- hw/usb/hcd-ohci.c | 6 ------ hw/usb/hcd-uhci.c | 16 ---------------- hw/versatilepb.c | 3 +-- 13 files changed, 11 insertions(+), 60 deletions(-) delete mode 100644 hw/usb-ohci.h delete mode 100644 hw/usb-uhci.h diff --git a/hw/alpha_sys.h b/hw/alpha_sys.h index d54b18f..f9506c6 100644 --- a/hw/alpha_sys.h +++ b/hw/alpha_sys.h @@ -8,7 +8,6 @@ #include "ide.h" #include "net.h" #include "pc.h" -#include "usb-ohci.h" #include "irq.h" diff --git a/hw/mips_fulong2e.c b/hw/mips_fulong2e.c index e3ba9dd..efdfdc2 100644 --- a/hw/mips_fulong2e.c +++ b/hw/mips_fulong2e.c @@ -29,7 +29,6 @@ #include "mips.h" #include "mips_cpudevs.h" #include "pci.h" -#include "usb-uhci.h" #include "qemu-char.h" #include "sysemu.h" #include "audio/audio.h" @@ -355,8 +354,10 @@ static void mips_fulong2e_init(ram_addr_t ram_size, const char *boot_device, isa_bus_irqs(isa_bus, i8259); vt82c686b_ide_init(pci_bus, hd, PCI_DEVFN(FULONG2E_VIA_SLOT, 1)); - usb_uhci_vt82c686b_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 2)); - usb_uhci_vt82c686b_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 3)); + pci_create_simple(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 2), + "vt82c686b-usb-uhci"); + pci_create_simple(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 3), + "vt82c686b-usb-uhci"); smbus = vt82c686b_pm_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 4), 0xeee1, NULL); diff --git a/hw/mips_malta.c b/hw/mips_malta.c index b1563ed..866699d 100644 --- a/hw/mips_malta.c +++ b/hw/mips_malta.c @@ -33,7 +33,6 @@ #include "mips.h" #include "mips_cpudevs.h" #include "pci.h" -#include "usb-uhci.h" #include "vmware_vga.h" #include "qemu-char.h" #include "sysemu.h" @@ -965,7 +964,7 @@ void mips_malta_init (ram_addr_t ram_size, isa_bus_irqs(isa_bus, s->i8259); pci_piix4_ide_init(pci_bus, hd, piix4_devfn + 1); - usb_uhci_piix4_init(pci_bus, piix4_devfn + 2); + pci_create_simple(pci_bus, piix4_devfn + 2, "piix4-usb-uhci"); smbus = piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100, isa_get_irq(NULL, 9), NULL, 0); /* TODO: Populate SPD eeprom data. */ diff --git a/hw/pc_piix.c b/hw/pc_piix.c index 6c5c40f..3f99f9a 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -28,8 +28,6 @@ #include "pc.h" #include "apic.h" #include "pci.h" -#include "usb-uhci.h" -#include "usb-ohci.h" #include "net.h" #include "boards.h" #include "ide.h" @@ -284,7 +282,7 @@ static void pc_init1(MemoryRegion *system_memory, floppy, idebus[0], idebus[1], rtc_state); if (pci_enabled && usb_enabled) { - usb_uhci_piix3_init(pci_bus, piix3_devfn + 2); + pci_create_simple(pci_bus, piix3_devfn + 2, "piix3-usb-uhci"); } if (pci_enabled && acpi_enabled) { diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c index 506187b..2fec5b4 100644 --- a/hw/ppc_newworld.c +++ b/hw/ppc_newworld.c @@ -54,7 +54,6 @@ #include "nvram.h" #include "pc.h" #include "pci.h" -#include "usb-ohci.h" #include "net.h" #include "sysemu.h" #include "boards.h" @@ -352,7 +351,7 @@ static void ppc_core99_init (ram_addr_t ram_size, dbdma_mem, cuda_mem, NULL, 3, ide_mem, escc_bar); if (usb_enabled) { - usb_ohci_init_pci(pci_bus, -1); + pci_create_simple(pci_bus, -1, "pci-ohci"); } /* U3 needs to use USB for input because Linux doesn't support via-cuda diff --git a/hw/ppc_oldworld.c b/hw/ppc_oldworld.c index 9295a34..49c2c97 100644 --- a/hw/ppc_oldworld.c +++ b/hw/ppc_oldworld.c @@ -34,7 +34,6 @@ #include "net.h" #include "isa.h" #include "pci.h" -#include "usb-ohci.h" #include "boards.h" #include "fw_cfg.h" #include "escc.h" @@ -278,7 +277,7 @@ static void ppc_heathrow_init (ram_addr_t ram_size, dbdma_mem, cuda_mem, nvr, 2, ide_mem, escc_bar); if (usb_enabled) { - usb_ohci_init_pci(pci_bus, -1); + pci_create_simple(pci_bus, -1, "pci-ohci"); } if (graphic_depth != 15 && graphic_depth != 32 && graphic_depth != 8) diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c index eb43fb5..dc9edd7 100644 --- a/hw/ppc_prep.c +++ b/hw/ppc_prep.c @@ -30,7 +30,6 @@ #include "isa.h" #include "pci.h" #include "pci_host.h" -#include "usb-ohci.h" #include "ppc.h" #include "boards.h" #include "qemu-log.h" @@ -688,7 +687,7 @@ static void ppc_prep_init (ram_addr_t ram_size, #endif if (usb_enabled) { - usb_ohci_init_pci(pci_bus, -1); + pci_create_simple(pci_bus, -1, "pci-ohci"); } m48t59 = m48t59_init_isa(isa_bus, 0x0074, NVRAM_SIZE, 59); diff --git a/hw/realview.c b/hw/realview.c index ae1bbcd..50ea67c 100644 --- a/hw/realview.c +++ b/hw/realview.c @@ -12,7 +12,6 @@ #include "primecell.h" #include "devices.h" #include "pci.h" -#include "usb-ohci.h" #include "net.h" #include "sysemu.h" #include "boards.h" @@ -305,7 +304,7 @@ static void realview_init(ram_addr_t ram_size, sysbus_connect_irq(busdev, 3, pic[51]); pci_bus = (PCIBus *)qdev_get_child_bus(dev, "pci"); if (usb_enabled) { - usb_ohci_init_pci(pci_bus, -1); + pci_create_simple(pci_bus, -1, "pci-ohci"); } n = drive_get_max_bus(IF_SCSI); while (n >= 0) { diff --git a/hw/usb-ohci.h b/hw/usb-ohci.h deleted file mode 100644 index eefcef3..0000000 --- a/hw/usb-ohci.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef QEMU_USB_OHCI_H -#define QEMU_USB_OHCI_H - -#include "qemu-common.h" - -void usb_ohci_init_pci(struct PCIBus *bus, int devfn); - -#endif - diff --git a/hw/usb-uhci.h b/hw/usb-uhci.h deleted file mode 100644 index 3e4d377..0000000 --- a/hw/usb-uhci.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef QEMU_USB_UHCI_H -#define QEMU_USB_UHCI_H - -#include "qemu-common.h" - -void usb_uhci_piix3_init(PCIBus *bus, int devfn); -void usb_uhci_piix4_init(PCIBus *bus, int devfn); -void usb_uhci_vt82c686b_init(PCIBus *bus, int devfn); - -#endif diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index dd79cef..51fa111 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -30,7 +30,6 @@ #include "qemu-timer.h" #include "hw/usb.h" #include "hw/pci.h" -#include "hw/usb-ohci.h" #include "hw/sysbus.h" #include "hw/qdev-addr.h" @@ -1815,11 +1814,6 @@ static int usb_ohci_initfn_pci(struct PCIDevice *dev) return 0; } -void usb_ohci_init_pci(struct PCIBus *bus, int devfn) -{ - pci_create_simple(bus, devfn, "pci-ohci"); -} - typedef struct { SysBusDevice busdev; OHCIState ohci; diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 7c2e9b3..5c708cf 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -29,7 +29,6 @@ #include "hw/usb.h" #include "hw/pci.h" #include "qemu-timer.h" -#include "hw/usb-uhci.h" #include "iov.h" #include "dma.h" @@ -1391,18 +1390,3 @@ static void uhci_register_types(void) } type_init(uhci_register_types) - -void usb_uhci_piix3_init(PCIBus *bus, int devfn) -{ - pci_create_simple(bus, devfn, "piix3-usb-uhci"); -} - -void usb_uhci_piix4_init(PCIBus *bus, int devfn) -{ - pci_create_simple(bus, devfn, "piix4-usb-uhci"); -} - -void usb_uhci_vt82c686b_init(PCIBus *bus, int devfn) -{ - pci_create_simple(bus, devfn, "vt82c686b-usb-uhci"); -} diff --git a/hw/versatilepb.c b/hw/versatilepb.c index b9102f4..c1687a5 100644 --- a/hw/versatilepb.c +++ b/hw/versatilepb.c @@ -13,7 +13,6 @@ #include "net.h" #include "sysemu.h" #include "pci.h" -#include "usb-ohci.h" #include "boards.h" #include "blockdev.h" #include "exec-memory.h" @@ -240,7 +239,7 @@ static void versatile_init(ram_addr_t ram_size, } } if (usb_enabled) { - usb_ohci_init_pci(pci_bus, -1); + pci_create_simple(pci_bus, -1, "pci-ohci"); } n = drive_get_max_bus(IF_SCSI); while (n >= 0) {