diff options
Diffstat (limited to 'sys/dev/sio/sio.c')
-rw-r--r-- | sys/dev/sio/sio.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index a409a55..0876620 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -692,7 +692,7 @@ sioprobe(dev) idev = dev; mcr_image = MCR_IENABLE; #ifdef COM_MULTIPORT - if (COM_ISMULTIPORT(flags) && !COM_NOTAST4(flags)) { + if (COM_ISMULTIPORT(flags)) { Port_t xiobase; u_long io; @@ -702,14 +702,18 @@ sioprobe(dev) device_get_unit(dev), COM_MPMASTER(flags)); idev = dev; } - if (bus_get_resource(idev, SYS_RES_IOPORT, 0, &io, NULL) == 0) { - xiobase = io; - if (bus_get_resource(idev, SYS_RES_IRQ, 0, NULL, NULL)) - outb(xiobase + com_scr, 0x80); /* no irq */ - else - outb(xiobase + com_scr, 0); + if (!COM_NOTAST4(flags)) { + if (bus_get_resource(idev, SYS_RES_IOPORT, 0, &io, + NULL) == 0) { + xiobase = io; + if (bus_get_resource(idev, SYS_RES_IRQ, 0, + NULL, NULL) == 0) + outb(xiobase + com_scr, 0x80); + else + outb(xiobase + com_scr, 0); + } + mcr_image = 0; } - mcr_image = 0; } #endif /* COM_MULTIPORT */ if (bus_get_resource(idev, SYS_RES_IRQ, 0, NULL, NULL) != 0) @@ -1011,7 +1015,7 @@ sioattach(dev) com->cfcr_image = CFCR_8BITS; com->dtr_wait = 3 * hz; com->loses_outints = COM_LOSESOUTINTS(flags) != 0; - com->no_irq = bus_get_resource(dev, SYS_RES_IRQ, 0, NULL, NULL); + com->no_irq = bus_get_resource(dev, SYS_RES_IRQ, 0, NULL, NULL) != 0; com->tx_fifo_size = 1; com->obufs[0].l_head = com->obuf1; com->obufs[1].l_head = com->obuf2; @@ -1170,8 +1174,8 @@ determined_type: ; printf(")"); masterdev = devclass_get_device(sio_devclass, COM_MPMASTER(flags)); - com->no_irq = bus_get_resource(masterdev, SYS_RES_IRQ, 0, NULL, - NULL); + com->no_irq = (masterdev == NULL || bus_get_resource(masterdev, + SYS_RES_IRQ, 0, NULL, NULL) != 0); } #endif /* COM_MULTIPORT */ if (unit == comconsole) |