qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@verge.net.au>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [patch 3/5] ioemu: Remove usb_ohci_init*()s devfn parameter as they are always passed as -1
Date: Mon, 23 Feb 2009 20:18:13 +1100	[thread overview]
Message-ID: <20090223092901.786219780@vergenet.net> (raw)
In-Reply-To: 20090223091810.891526738@vergenet.net

[-- Attachment #1: qemu-usb_ohci_init-no-devfn-arg.patch --]
[-- Type: text/plain, Size: 6774 bytes --]

Signed-off-by: Simon Horman <horms@verge.net.au>

Index: qemu/hw/pci.h
===================================================================
--- qemu.orig/hw/pci.h	2009-02-23 18:42:23.000000000 +1100
+++ qemu/hw/pci.h	2009-02-23 18:44:19.000000000 +1100
@@ -274,7 +274,7 @@ void usb_uhci_piix3_init(PCIBus *bus, in
 void usb_uhci_piix4_init(PCIBus *bus, int devfn);
 
 /* usb-ohci.c */
-void usb_ohci_init_pci(struct PCIBus *bus, int num_ports, int devfn);
+void usb_ohci_init_pci(struct PCIBus *bus, int num_ports);
 
 /* eepro100.c */
 
Index: qemu/hw/ppc_oldworld.c
===================================================================
--- qemu.orig/hw/ppc_oldworld.c	2009-02-23 18:28:47.000000000 +1100
+++ qemu/hw/ppc_oldworld.c	2009-02-23 18:44:19.000000000 +1100
@@ -358,7 +358,7 @@ static void ppc_heathrow_init (ram_addr_
                escc_mem_index);
 
     if (usb_enabled) {
-        usb_ohci_init_pci(pci_bus, 3, -1);
+        usb_ohci_init_pci(pci_bus, 3);
     }
 
     if (graphic_depth != 15 && graphic_depth != 32 && graphic_depth != 8)
Index: qemu/hw/ppc_prep.c
===================================================================
--- qemu.orig/hw/ppc_prep.c	2009-02-23 18:28:47.000000000 +1100
+++ qemu/hw/ppc_prep.c	2009-02-23 18:44:19.000000000 +1100
@@ -734,7 +734,7 @@ static void ppc_prep_init (ram_addr_t ra
 #endif
 
     if (usb_enabled) {
-        usb_ohci_init_pci(pci_bus, 3, -1);
+        usb_ohci_init_pci(pci_bus, 3);
     }
 
     m48t59 = m48t59_init(i8259[8], 0, 0x0074, NVRAM_SIZE, 59);
Index: qemu/hw/realview.c
===================================================================
--- qemu.orig/hw/realview.c	2009-02-23 18:42:23.000000000 +1100
+++ qemu/hw/realview.c	2009-02-23 18:44:19.000000000 +1100
@@ -106,7 +106,7 @@ static void realview_init(ram_addr_t ram
 
     pci_bus = pci_vpb_init(pic, 48, 1);
     if (usb_enabled) {
-        usb_ohci_init_pci(pci_bus, 3, -1);
+        usb_ohci_init_pci(pci_bus, 3);
     }
     if (drive_get_max_bus(IF_SCSI) > 0) {
         fprintf(stderr, "qemu: too many SCSI bus\n");
Index: qemu/hw/versatilepb.c
===================================================================
--- qemu.orig/hw/versatilepb.c	2009-02-23 18:42:23.000000000 +1100
+++ qemu/hw/versatilepb.c	2009-02-23 18:44:19.000000000 +1100
@@ -201,7 +201,7 @@ static void versatile_init(ram_addr_t ra
         }
     }
     if (usb_enabled) {
-        usb_ohci_init_pci(pci_bus, 3, -1);
+        usb_ohci_init_pci(pci_bus, 3);
     }
     if (drive_get_max_bus(IF_SCSI) > 0) {
         fprintf(stderr, "qemu: too many SCSI bus\n");
Index: qemu/hw/usb-ohci.c
===================================================================
--- qemu.orig/hw/usb-ohci.c	2009-02-23 18:28:47.000000000 +1100
+++ qemu/hw/usb-ohci.c	2009-02-23 18:44:19.000000000 +1100
@@ -1619,7 +1619,7 @@ static CPUWriteMemoryFunc *ohci_writefn[
     ohci_mem_write
 };
 
-static void usb_ohci_init(OHCIState *ohci, int num_ports, int devfn,
+static void usb_ohci_init(OHCIState *ohci, int num_ports,
             qemu_irq irq, enum ohci_type type, const char *name)
 {
     int i;
@@ -1668,12 +1668,12 @@ static void ohci_mapfunc(PCIDevice *pci_
     cpu_register_physical_memory(addr, size, ohci->state.mem);
 }
 
-void usb_ohci_init_pci(struct PCIBus *bus, int num_ports, int devfn)
+void usb_ohci_init_pci(struct PCIBus *bus, int num_ports)
 {
     OHCIPCIState *ohci;
 
     ohci = (OHCIPCIState *)pci_register_device(bus, "OHCI USB", sizeof(*ohci),
-                                               devfn, NULL, NULL);
+                                               -1, NULL, NULL);
     if (ohci == NULL) {
         fprintf(stderr, "usb-ohci: Failed to register PCI device\n");
         return;
@@ -1685,20 +1685,18 @@ void usb_ohci_init_pci(struct PCIBus *bu
     pci_config_set_class(ohci->pci_dev.config, PCI_CLASS_SERIAL_USB);
     ohci->pci_dev.config[0x3d] = 0x01; /* interrupt pin 1 */
 
-    usb_ohci_init(&ohci->state, num_ports, devfn, ohci->pci_dev.irq[0],
+    usb_ohci_init(&ohci->state, num_ports, ohci->pci_dev.irq[0],
                   OHCI_TYPE_PCI, ohci->pci_dev.name);
 
     pci_register_io_region((struct PCIDevice *)ohci, 0, 256,
                            PCI_ADDRESS_SPACE_MEM, ohci_mapfunc);
 }
 
-void usb_ohci_init_pxa(target_phys_addr_t base, int num_ports, int devfn,
-                       qemu_irq irq)
+void usb_ohci_init_pxa(target_phys_addr_t base, int num_ports, qemu_irq irq)
 {
     OHCIState *ohci = (OHCIState *)qemu_mallocz(sizeof(OHCIState));
 
-    usb_ohci_init(ohci, num_ports, devfn, irq,
-                  OHCI_TYPE_PXA, "OHCI USB");
+    usb_ohci_init(ohci, num_ports, irq, OHCI_TYPE_PXA, "OHCI USB");
 
     cpu_register_physical_memory(base, 0x1000, ohci->mem);
 }
Index: qemu/hw/pxa.h
===================================================================
--- qemu.orig/hw/pxa.h	2009-02-23 18:28:47.000000000 +1100
+++ qemu/hw/pxa.h	2009-02-23 18:44:19.000000000 +1100
@@ -219,7 +219,6 @@ struct pxa2xx_state_s *pxa270_init(unsig
 struct pxa2xx_state_s *pxa255_init(unsigned int sdram_size);
 
 /* usb-ohci.c */
-void usb_ohci_init_pxa(target_phys_addr_t base, int num_ports, int devfn,
-                       qemu_irq irq);
+void usb_ohci_init_pxa(target_phys_addr_t base, int num_ports, qemu_irq irq);
 
 #endif	/* PXA_H */
Index: qemu/hw/pxa2xx.c
===================================================================
--- qemu.orig/hw/pxa2xx.c	2009-02-23 18:28:47.000000000 +1100
+++ qemu/hw/pxa2xx.c	2009-02-23 18:44:19.000000000 +1100
@@ -2112,7 +2112,7 @@ struct pxa2xx_state_s *pxa270_init(unsig
     }
 
     if (usb_enabled) {
-        usb_ohci_init_pxa(0x4c000000, 3, -1, s->pic[PXA2XX_PIC_USBH1]);
+        usb_ohci_init_pxa(0x4c000000, 3, s->pic[PXA2XX_PIC_USBH1]);
     }
 
     s->pcmcia[0] = pxa2xx_pcmcia_init(0x20000000);
@@ -2234,7 +2234,7 @@ struct pxa2xx_state_s *pxa255_init(unsig
     }
 
     if (usb_enabled) {
-        usb_ohci_init_pxa(0x4c000000, 3, -1, s->pic[PXA2XX_PIC_USBH1]);
+        usb_ohci_init_pxa(0x4c000000, 3, s->pic[PXA2XX_PIC_USBH1]);
     }
 
     s->pcmcia[0] = pxa2xx_pcmcia_init(0x20000000);
Index: qemu/hw/ppc_newworld.c
===================================================================
--- qemu.orig/hw/ppc_newworld.c	2009-02-23 18:45:13.000000000 +1100
+++ qemu/hw/ppc_newworld.c	2009-02-23 18:45:29.000000000 +1100
@@ -304,7 +304,7 @@ static void ppc_core99_init (ram_addr_t 
                escc_mem_index);
 
     if (usb_enabled) {
-        usb_ohci_init_pci(pci_bus, 3, -1);
+        usb_ohci_init_pci(pci_bus, 3);
     }
 
     if (graphic_depth != 15 && graphic_depth != 32 && graphic_depth != 8)

-- 

-- 
Simon Horman
  VA Linux Systems Japan K.K., Sydney, Australia Satellite Office
  H: www.vergenet.net/~horms/             W: www.valinux.co.jp/en

  parent reply	other threads:[~2009-02-23  9:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-23  9:18 [Qemu-devel] [patch 0/5] PCI clean-up Simon Horman
2009-02-23  9:18 ` [Qemu-devel] [patch 1/5] ioemu: Remove lsi_scsi_init()s devfn parameter as it is always passed as -1 Simon Horman
2009-02-23  9:18 ` [Qemu-devel] [patch 2/5] " Simon Horman
2009-02-23  9:18 ` Simon Horman [this message]
2009-02-23  9:18 ` [Qemu-devel] [patch 4/5] iommu: Define PCI_DEVFN_AUTO and use it Simon Horman
2009-02-23  9:18 ` [Qemu-devel] [patch 5/5] iommu: Use PCI_DEVFN, PCI_SLOT and PCI_FUNC Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090223092901.786219780@vergenet.net \
    --to=horms@verge.net.au \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).