Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
hw/char/parallel: Move TYPE_ISA_PARALLEL to the header file
We are going to require the macro from other files, too, so move
this #define to the header file.

Message-Id: <20230512124033.502654-9-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
  • Loading branch information
huth committed May 22, 2023
1 parent cf2528a commit 963e94a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hw/char/parallel-isa.c
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion hw/char/parallel.c
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion hw/isa/isa-superio.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions include/hw/char/parallel.h
Expand Up @@ -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,
Expand Down

0 comments on commit 963e94a

Please sign in to comment.