qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, "John Snow" <jsnow@redhat.com>,
	qemu-block@nongnu.org, qemu-arm@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>
Subject: [PATCH v2 18/24] hw/ide: Rename ISA specific ide_init_ioport -> ide_bus_init_ioport_isa
Date: Mon, 20 Feb 2023 10:13:52 +0100	[thread overview]
Message-ID: <20230220091358.17038-19-philmd@linaro.org> (raw)
In-Reply-To: <20230220091358.17038-1-philmd@linaro.org>

Rename ide_init_ioport() as ide_bus_init_ioport_isa() to make
explicit it expects an ISA device. Move the declaration to
"hw/ide/isa.h" where it belongs.

Message-Id: <20230215161641.32663-13-philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/ide/ioport.c           | 4 +++-
 hw/ide/isa.c              | 2 +-
 hw/ide/piix.c             | 5 +++--
 include/hw/ide/internal.h | 1 -
 include/hw/ide/isa.h      | 3 +++
 5 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/hw/ide/ioport.c b/hw/ide/ioport.c
index e6caa537fa..7156c465da 100644
--- a/hw/ide/ioport.c
+++ b/hw/ide/ioport.c
@@ -35,6 +35,7 @@
 #include "qemu/cutils.h"
 #include "sysemu/replay.h"
 
+#include "hw/ide/isa.h"
 #include "hw/ide/internal.h"
 #include "trace.h"
 
@@ -50,7 +51,8 @@ static const MemoryRegionPortio ide_portio2_list[] = {
     PORTIO_END_OF_LIST(),
 };
 
-int ide_init_ioport(IDEBus *bus, ISADevice *dev, int iobase, int iobase2)
+int ide_bus_init_ioport_isa(IDEBus *bus, ISADevice *dev,
+                            int iobase, int iobase2)
 {
     int ret;
 
diff --git a/hw/ide/isa.c b/hw/ide/isa.c
index 95053e026f..6eed16bf87 100644
--- a/hw/ide/isa.c
+++ b/hw/ide/isa.c
@@ -71,7 +71,7 @@ static void isa_ide_realizefn(DeviceState *dev, Error **errp)
     ISAIDEState *s = ISA_IDE(dev);
 
     ide_bus_init(&s->bus, sizeof(s->bus), dev, 0, 2);
-    ide_init_ioport(&s->bus, isadev, s->iobase, s->iobase2);
+    ide_bus_init_ioport_isa(&s->bus, isadev, s->iobase, s->iobase2);
     ide_bus_init_output_irq(&s->bus, isa_get_irq(isadev, s->irqnum));
     vmstate_register(VMSTATE_IF(dev), 0, &vmstate_ide_isa, s);
     ide_bus_register_restart_cb(&s->bus);
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index 2f71376b93..fc44c261cc 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -38,6 +38,7 @@
 
 #include "hw/ide/piix.h"
 #include "hw/ide/pci.h"
+#include "hw/ide/isa.h"
 #include "trace.h"
 
 static uint64_t bmdma_read(void *opaque, hwaddr addr, unsigned size)
@@ -140,8 +141,8 @@ static int pci_piix_init_ports(PCIIDEState *d)
 
     for (i = 0; i < 2; i++) {
         ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2);
-        ret = ide_init_ioport(&d->bus[i], NULL, port_info[i].iobase,
-                              port_info[i].iobase2);
+        ret = ide_bus_init_ioport_isa(&d->bus[i], NULL, port_info[i].iobase,
+                                      port_info[i].iobase2);
         if (ret) {
             return ret;
         }
diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h
index d9f1f77dd5..d3b7fdc504 100644
--- a/include/hw/ide/internal.h
+++ b/include/hw/ide/internal.h
@@ -618,7 +618,6 @@ int ide_init_drive(IDEState *s, BlockBackend *blk, IDEDriveKind kind,
                    int chs_trans, Error **errp);
 void ide_exit(IDEState *s);
 void ide_bus_init_output_irq(IDEBus *bus, qemu_irq irq_out);
-int ide_init_ioport(IDEBus *bus, ISADevice *isa, int iobase, int iobase2);
 void ide_bus_set_irq(IDEBus *bus);
 void ide_bus_register_restart_cb(IDEBus *bus);
 
diff --git a/include/hw/ide/isa.h b/include/hw/ide/isa.h
index 1cd0ff1fa6..7f7a850265 100644
--- a/include/hw/ide/isa.h
+++ b/include/hw/ide/isa.h
@@ -10,11 +10,14 @@
 #define HW_IDE_ISA_H
 
 #include "qom/object.h"
+#include "hw/ide/internal.h"
 
 #define TYPE_ISA_IDE "isa-ide"
 OBJECT_DECLARE_SIMPLE_TYPE(ISAIDEState, ISA_IDE)
 
 ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int irqnum,
                         DriveInfo *hd0, DriveInfo *hd1);
+int ide_bus_init_ioport_isa(IDEBus *bus, ISADevice *isa,
+                            int iobase, int iobase2);
 
 #endif
-- 
2.38.1



  parent reply	other threads:[~2023-02-20  9:18 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20  9:13 [PATCH v2 00/24] hw/ide: QOM/QDev housekeeping Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 01/24] MAINTAINERS: Mark IDE and Floppy as "Odd Fixes" Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 02/24] hw/ide/mmio: Use CamelCase for MMIO_IDE state name Philippe Mathieu-Daudé
2023-02-27 10:49   ` Alex Bennée
2023-02-20  9:13 ` [PATCH v2 03/24] hw/ide/mmio: Extract TYPE_MMIO_IDE declarations to 'hw/ide/mmio.h' Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 04/24] hw/ide/isa: Rename isairq -> irqnum Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 05/24] hw/ide/isa: Extract TYPE_ISA_IDE declarations to 'hw/ide/isa.h' Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 06/24] hw/ide/isa: Remove intermediate ISAIDEState::irq variable Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 07/24] hw/ide/atapi: Restrict 'scsi/constants.h' inclusion Philippe Mathieu-Daudé
2023-02-27 11:12   ` Alex Bennée
2023-02-20  9:13 ` [PATCH v2 08/24] hw/ide: Remove unused 'qapi/qapi-types-run-state.h' Philippe Mathieu-Daudé
2023-02-27 11:13   ` Alex Bennée
2023-02-20  9:13 ` [PATCH v2 09/24] hw/ide: Include 'exec/ioport.h' instead of 'hw/isa/isa.h' Philippe Mathieu-Daudé
2023-02-27 11:13   ` Alex Bennée
2023-02-20  9:13 ` [PATCH v2 10/24] hw/ide: Un-inline ide_set_irq() Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 11/24] hw/ide: Rename ide_set_irq() -> ide_bus_set_irq() Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 12/24] hw/ide: Rename ide_create_drive() -> ide_bus_create_drive() Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 13/24] hw/ide: Rename ide_register_restart_cb -> ide_bus_register_restart_cb Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 14/24] hw/ide: Rename ide_exec_cmd() -> ide_bus_exec_cmd() Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 15/24] hw/ide: Rename ide_init2() -> ide_bus_init_output_irq() Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 16/24] hw/ide: Rename idebus_active_if() -> ide_bus_active_if() Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 17/24] hw/ide: Declare ide_get_[geometry/bios_chs_trans] in 'hw/ide/internal.h' Philippe Mathieu-Daudé
2023-02-27 11:17   ` Alex Bennée
2023-02-27 11:22     ` Philippe Mathieu-Daudé
2023-02-20  9:13 ` Philippe Mathieu-Daudé [this message]
2023-02-20  9:13 ` [PATCH v2 19/24] hw/ide/ioport: Remove unnecessary includes Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 20/24] hw/ide/pci: Unexport bmdma_active_if() Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 21/24] hw/ide/piix: Remove unused includes Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 22/24] hw/ide/piix: Pass Error* to pci_piix_init_ports() for better error msg Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 23/24] hw/ide/piix: Refactor pci_piix_init_ports as pci_piix_init_bus per bus Philippe Mathieu-Daudé
2023-02-20  9:13 ` [PATCH v2 24/24] hw/ide/ahci: trace ncq write command as write instead of read Philippe Mathieu-Daudé
2023-02-24 22:23 ` [PATCH v2 00/24] hw/ide: QOM/QDev housekeeping Philippe Mathieu-Daudé

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=20230220091358.17038-19-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=jsnow@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.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).