From ea686c954f3d7040d88656349e8f8bade7974ad7 Mon Sep 17 00:00:00 2001 From: Oleg Safiullin Date: Mon, 24 Dec 2007 14:07:48 +0000 Subject: alwais unmap i/o space in it_match --- sys/dev/isa/it.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sys/dev/isa/it.c') diff --git a/sys/dev/isa/it.c b/sys/dev/isa/it.c index a6c965c5012..11707b69918 100644 --- a/sys/dev/isa/it.c +++ b/sys/dev/isa/it.c @@ -1,4 +1,4 @@ -/* $OpenBSD: it.c,v 1.26 2007/12/23 17:44:07 form Exp $ */ +/* $OpenBSD: it.c,v 1.27 2007/12/24 14:07:47 form Exp $ */ /* * Copyright (c) 2007 Oleg Safiullin @@ -118,14 +118,17 @@ it_match(struct device *parent, void *match, void *aux) return (0); } - /* check for ITE vendor ID */ + /* get vendor id */ bus_space_write_1(ia->ia_iot, ioh, IT_EC_ADDR, IT_EC_VENDID); - if (bus_space_read_1(ia->ia_iot, ioh, IT_EC_DATA) != IT_VEND_ITE) - return (0); + cr = bus_space_read_1(ia->ia_iot, ioh, IT_EC_DATA); /* unmap EC i/o space */ bus_space_unmap(ia->ia_iot, ioh, 8); + /* check for ITE vendor ID */ + if (cr != IT_VEND_ITE) + return (0); + /* map i/o space */ if (bus_space_map(ia->ia_iot, IO_IT, 2, 0, &ioh) != 0) { DPRINTF(("it_probe: can't map i/o space")); -- cgit v1.2.3