From 4496dc49ec9a6e24e9eeb2da970ed0ec0051968e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Sat, 22 Oct 2016 12:52:44 +0300 Subject: sun4uv: fix serial initialization regression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since commit b6607a1a204d, serial_hds_isa_init() was introduced to factor out serial_isa_init() loops. However, sun4uv shouldn't start from 0 when there is a mm serial on 0 already. Add a "from" argument to serial_hds_isa_init(). Signed-off-by: Marc-André Lureau Message-Id: <20161022095318.17775-5-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- hw/char/serial-isa.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'hw/char') diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c index 1594ec4..54d3a12 100644 --- a/hw/char/serial-isa.c +++ b/hw/char/serial-isa.c @@ -133,13 +133,14 @@ static void serial_isa_init(ISABus *bus, int index, CharDriverState *chr) qdev_init_nofail(dev); } -void serial_hds_isa_init(ISABus *bus, int n) +void serial_hds_isa_init(ISABus *bus, int from, int to) { int i; - assert(n <= MAX_SERIAL_PORTS); + assert(from >= 0); + assert(to <= MAX_SERIAL_PORTS); - for (i = 0; i < n; ++i) { + for (i = from; i < to; ++i) { if (serial_hds[i]) { serial_isa_init(bus, i, serial_hds[i]); } -- cgit v1.1