[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/18] hw/char/parallel: Move TYPE_ISA_PARALLEL to the header fil
From: |
Thomas Huth |
Subject: |
[PATCH 08/18] hw/char/parallel: Move TYPE_ISA_PARALLEL to the header file |
Date: |
Fri, 12 May 2023 14:40:23 +0200 |
We are going to require the macro from other files, too, so move
this #define to the header file.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/hw/char/parallel.h | 2 ++
hw/char/parallel-isa.c | 2 +-
hw/char/parallel.c | 1 -
hw/isa/isa-superio.c | 3 ++-
4 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/hw/char/parallel.h b/include/hw/char/parallel.h
index 0a23c0f57e..29d2876d00 100644
--- a/include/hw/char/parallel.h
+++ b/include/hw/char/parallel.h
@@ -4,6 +4,8 @@
#include "hw/isa/isa.h"
#include "chardev/char.h"
+#define TYPE_ISA_PARALLEL "isa-parallel"
+
void parallel_hds_isa_init(ISABus *bus, int n);
bool parallel_mm_init(MemoryRegion *address_space,
diff --git a/hw/char/parallel-isa.c b/hw/char/parallel-isa.c
index 1ccbb96e70..547ae69304 100644
--- a/hw/char/parallel-isa.c
+++ b/hw/char/parallel-isa.c
@@ -21,7 +21,7 @@ static void parallel_init(ISABus *bus, int index, Chardev
*chr)
DeviceState *dev;
ISADevice *isadev;
- isadev = isa_new("isa-parallel");
+ isadev = isa_new(TYPE_ISA_PARALLEL);
dev = DEVICE(isadev);
qdev_prop_set_uint32(dev, "index", index);
qdev_prop_set_chr(dev, "chardev", chr);
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index af551e7864..3d32589bb3 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -93,7 +93,6 @@ typedef struct ParallelState {
PortioList portio_list;
} ParallelState;
-#define TYPE_ISA_PARALLEL "isa-parallel"
OBJECT_DECLARE_SIMPLE_TYPE(ISAParallelState, ISA_PARALLEL)
struct ISAParallelState {
diff --git a/hw/isa/isa-superio.c b/hw/isa/isa-superio.c
index c81bfe58ef..9292ec3bcf 100644
--- a/hw/isa/isa-superio.c
+++ b/hw/isa/isa-superio.c
@@ -16,6 +16,7 @@
#include "qapi/error.h"
#include "sysemu/blockdev.h"
#include "chardev/char.h"
+#include "hw/char/parallel.h"
#include "hw/block/fdc.h"
#include "hw/isa/superio.h"
#include "hw/qdev-properties.h"
@@ -51,7 +52,7 @@ static void isa_superio_realize(DeviceState *dev, Error
**errp)
} else {
name = g_strdup_printf("parallel%d", i);
}
- isa = isa_new("isa-parallel");
+ isa = isa_new(TYPE_ISA_PARALLEL);
d = DEVICE(isa);
qdev_prop_set_uint32(d, "index", i);
if (k->parallel.get_iobase) {
--
2.31.1
- [PATCH 00/18] Allow qtests with --without-default-devices (part 1), Thomas Huth, 2023/05/12
- [PATCH 02/18] softmmu/vl.c: Check for the availability of the VGA device before using it, Thomas Huth, 2023/05/12
- [PATCH 01/18] hw/i386/Kconfig: ISAPC works fine without VGA_ISA, Thomas Huth, 2023/05/12
- [PATCH 05/18] hw/ppc: Use MachineClass->default_nic in the ppc machines, Thomas Huth, 2023/05/12
- [PATCH 04/18] softmmu/vl.c: Disable default NIC if it has not been compiled into the binary, Thomas Huth, 2023/05/12
- [PATCH 07/18] hw/sh4: Use MachineClass->default_nic in the sh4 r2d machine, Thomas Huth, 2023/05/12
- [PATCH 03/18] hw: Move the default NIC machine class setting from the x86 to the generic one, Thomas Huth, 2023/05/12
- [PATCH 08/18] hw/char/parallel: Move TYPE_ISA_PARALLEL to the header file,
Thomas Huth <=
- [PATCH 06/18] hw/s390x: Use MachineClass->default_nic in the s390x machine, Thomas Huth, 2023/05/12
- [PATCH 09/18] hw/i386: Ignore the default parallel port if it has not been compiled into QEMU, Thomas Huth, 2023/05/12
- [PATCH 10/18] hw/sparc64/sun4u: Use MachineClass->default_nic and MachineClass->no_parallel, Thomas Huth, 2023/05/12
- [PATCH 11/18] tests/qtest/readconfig-test: Check for the availability of USB controllers, Thomas Huth, 2023/05/12
- [PATCH 12/18] tests/qtest/usb-hcd-uhci-test: Skip test if UHCI controller is not available, Thomas Huth, 2023/05/12
- [PATCH 15/18] tests/qtest: Check for the availability of virtio-ccw devices before using them, Thomas Huth, 2023/05/12
- [PATCH 13/18] tests/qtest/cdrom-test: Fix the test to also work without optional devices, Thomas Huth, 2023/05/12
- [PATCH 14/18] tests/qtest/virtio-ccw-test: Remove superfluous tests, Thomas Huth, 2023/05/12
- [PATCH 16/18] tests/qtest/meson.build: Run the net filter tests only with default devices, Thomas Huth, 2023/05/12