From 3490987ba082dfafb57d4593dea497ebaf059853 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sat, 28 Jun 2003 16:23:55 +0000 Subject: Be prepared to the fact that the user may unplug a card before it was fully initialized. --- sys/arch/sparc/dev/ts102.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sys/arch/sparc/dev/ts102.c') diff --git a/sys/arch/sparc/dev/ts102.c b/sys/arch/sparc/dev/ts102.c index 35c16c7de98..7d639585f7c 100644 --- a/sys/arch/sparc/dev/ts102.c +++ b/sys/arch/sparc/dev/ts102.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ts102.c,v 1.7 2003/06/28 13:30:17 miod Exp $ */ +/* $OpenBSD: ts102.c,v 1.8 2003/06/28 16:23:54 miod Exp $ */ /* * Copyright (c) 2003, Miodrag Vallat. * @@ -563,7 +563,12 @@ tslot_slot_enable(pcmcia_chipset_handle_t pch) * here. */ for (i = 30000; i != 0; i--) { - if (TSLOT_READ(td, TS102_REG_CARD_A_STS) & TS102_CARD_STS_RDY) + status = TSLOT_READ(td, TS102_REG_CARD_A_STS); + if ((status & TS102_CARD_STS_PRES) == 0) { + tslot_slot_disable(pch); + return; + } + if (status & TS102_CARD_STS_RDY) break; else DELAY(100); -- cgit v1.2.3