All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: jsnow@redhat.com, philmd@redhat.com, amarkovic@wavecomp.com,
	mst@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org,
	balaton@eik.bme.hu
Subject: [PATCH 2/7] ide/via: Get rid of via_ide_init()
Date: Fri, 13 Mar 2020 08:24:39 +0000	[thread overview]
Message-ID: <20200313082444.2439-3-mark.cave-ayland@ilande.co.uk> (raw)
In-Reply-To: <20200313082444.2439-1-mark.cave-ayland@ilande.co.uk>

From: BALATON Zoltan <balaton@eik.bme.hu>

Follow example of CMD646 and remove via_ide_init function and do it
directly in board code instead.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
 hw/ide/via.c            | 8 --------
 hw/mips/mips_fulong2e.c | 5 ++++-
 include/hw/ide.h        | 1 -
 3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/hw/ide/via.c b/hw/ide/via.c
index 84f0efff94..3153be8862 100644
--- a/hw/ide/via.c
+++ b/hw/ide/via.c
@@ -211,14 +211,6 @@ static void via_ide_exitfn(PCIDevice *dev)
     }
 }
 
-void via_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn)
-{
-    PCIDevice *dev;
-
-    dev = pci_create_simple(bus, devfn, "via-ide");
-    pci_ide_create_devs(dev, hd_table);
-}
-
 static void via_ide_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 4727b1d3a4..639ba2a091 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -37,6 +37,7 @@
 #include "qemu/log.h"
 #include "hw/loader.h"
 #include "hw/ide.h"
+#include "hw/ide/pci.h"
 #include "elf.h"
 #include "hw/isa/vt82c686.h"
 #include "hw/rtc/mc146818rtc.h"
@@ -239,6 +240,7 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus, int slot, qemu_irq intc,
     qemu_irq *i8259;
     ISABus *isa_bus;
     DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
+    PCIDevice *dev;
 
     isa_bus = vt82c686b_isa_init(pci_bus, PCI_DEVFN(slot, 0));
     if (!isa_bus) {
@@ -256,8 +258,9 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus, int slot, qemu_irq intc,
     /* Super I/O */
     isa_create_simple(isa_bus, TYPE_VT82C686B_SUPERIO);
 
+    dev = pci_create_simple(pci_bus, PCI_DEVFN(slot, 1), "via-ide");
     ide_drive_get(hd, ARRAY_SIZE(hd));
-    via_ide_init(pci_bus, hd, PCI_DEVFN(slot, 1));
+    pci_ide_create_devs(dev, hd);
 
     pci_create_simple(pci_bus, PCI_DEVFN(slot, 2), "vt82c686b-usb-uhci");
     pci_create_simple(pci_bus, PCI_DEVFN(slot, 3), "vt82c686b-usb-uhci");
diff --git a/include/hw/ide.h b/include/hw/ide.h
index 28d8a06439..575c099b5b 100644
--- a/include/hw/ide.h
+++ b/include/hw/ide.h
@@ -18,7 +18,6 @@ PCIDevice *pci_piix3_xen_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
 PCIDevice *pci_piix3_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
 PCIDevice *pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
 int pci_piix3_xen_ide_unplug(DeviceState *dev, bool aux);
-void via_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
 
 /* ide-mmio.c */
 void mmio_ide_init_drives(DeviceState *dev, DriveInfo *hd0, DriveInfo *hd1);
-- 
2.20.1



  parent reply	other threads:[~2020-03-13  8:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13  8:24 [PATCH 0/7] via-ide: fixes and improvements Mark Cave-Ayland
2020-03-13  8:24 ` [PATCH 1/7] via-ide: move registration of VMStateDescription to DeviceClass Mark Cave-Ayland
2020-03-13 19:50   ` Philippe Mathieu-Daudé
2020-03-13  8:24 ` Mark Cave-Ayland [this message]
2020-03-13  8:24 ` [PATCH 3/7] pci: Honour wmask when resetting PCI_INTERRUPT_LINE Mark Cave-Ayland
2020-03-13  8:24 ` [PATCH 4/7] via-ide: ensure that PCI_INTERRUPT_LINE is hard-wired to its default value Mark Cave-Ayland
2020-03-13  8:24 ` [PATCH 5/7] via-ide: initialise IDE controller in legacy mode Mark Cave-Ayland
2020-03-13  8:24 ` [PATCH 6/7] via-ide: allow guests to write to PCI_CLASS_PROG Mark Cave-Ayland
2020-03-13  8:24 ` [PATCH 7/7] via-ide: always use legacy IRQ 14/15 routing Mark Cave-Ayland
2020-03-13 12:12 ` [PATCH 0/7] via-ide: fixes and improvements BALATON Zoltan
2020-03-13 16:34 ` [EXTERNAL][PATCH " Aleksandar Markovic
2020-03-13 17:15   ` BALATON Zoltan
2020-03-13 17:57 ` [PATCH " John Snow
2020-03-13 20:50   ` BALATON Zoltan
2020-03-14  9:15   ` Mark Cave-Ayland
2020-03-17  4:22     ` John Snow

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=20200313082444.2439-3-mark.cave-ayland@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=amarkovic@wavecomp.com \
    --cc=balaton@eik.bme.hu \
    --cc=jsnow@redhat.com \
    --cc=mst@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-block@nongnu.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.