Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
[qemu.git] / hw / char / parallel-isa.c
blob639e179585406a9a1399dd729a106a8f205f0f27
1 /*
2 * QEMU Parallel PORT (ISA bus helpers)
4 * Copyright (c) 2003 Fabrice Bellard
6 * SPDX-License-Identifier: MIT
7 */
8 #include "qemu/osdep.h"
9 #include "sysemu/sysemu.h"
10 #include "hw/isa/isa.h"
11 #include "hw/char/parallel.h"
13 static void parallel_init(ISABus *bus, int index, Chardev *chr)
15 DeviceState *dev;
16 ISADevice *isadev;
18 isadev = isa_create(bus, "isa-parallel");
19 dev = DEVICE(isadev);
20 qdev_prop_set_uint32(dev, "index", index);
21 qdev_prop_set_chr(dev, "chardev", chr);
22 qdev_init_nofail(dev);
25 void parallel_hds_isa_init(ISABus *bus, int n)
27 int i;
29 assert(n <= MAX_PARALLEL_PORTS);
31 for (i = 0; i < n; i++) {
32 if (parallel_hds[i]) {
33 parallel_init(bus, i, parallel_hds[i]);