diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2003-06-28 16:23:55 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2003-06-28 16:23:55 +0000 |
commit | 3490987ba082dfafb57d4593dea497ebaf059853 (patch) | |
tree | 68749cf09931715ab325a34cf7b804042494cf64 /sys/arch/sparc/dev/ts102.c | |
parent | 6fda28d811503c3515ba7065645e94d7053b211d (diff) |
Be prepared to the fact that the user may unplug a card before it was
fully initialized.
Diffstat (limited to 'sys/arch/sparc/dev/ts102.c')
-rw-r--r-- | sys/arch/sparc/dev/ts102.c | 9 |
1 files changed, 7 insertions, 2 deletions
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); |