From 388a95bade08753f0d979287d4fc947af1758f9f Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 8 Nov 2018 19:38:07 +0100 Subject: [PATCH] The inst variable of the serial_t struct is now always set. --- src/serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serial.c b/src/serial.c index de5d94aa9..5b8896081 100644 --- a/src/serial.c +++ b/src/serial.c @@ -402,6 +402,7 @@ serial_init(const device_t *info) memset(dev, 0, sizeof(serial_t)); dev->base_address = next_inst ? 0x03f8 : 0x02f8; + dev->inst = next_inst; if (serial_enabled[next_inst]) { serial_log("Adding serial port %i...\n", next_inst); @@ -409,7 +410,6 @@ serial_init(const device_t *info) serial_read, NULL, NULL, serial_write, NULL, NULL, dev); dev->irq = next_inst ? 4 : 3; dev->type = info->local; - dev->inst = next_inst; memset(&(serial_devices[next_inst]), 0, sizeof(serial_device_t)); dev->sd = &(serial_devices[next_inst]); dev->sd->serial = dev;