diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-09-26 22:43:19 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-09-26 22:43:19 +0000 |
commit | 1eae2bddb310197dc357ee38502c26c789b8dbe8 (patch) | |
tree | f83d8a8e2fd2358229f2a1a6caa9f923959ea50b /sys | |
parent | 6e2b42bd89bd45b8441c9c3b19f2deea36837b82 (diff) |
minor knf
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/cardbus/cardbus.c | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index 879fa4fd257..b292503791c 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cardbus.c,v 1.30 2005/09/13 18:53:01 fgsch Exp $ */ +/* $OpenBSD: cardbus.c,v 1.31 2005/09/26 22:43:18 deraadt Exp $ */ /* $NetBSD: cardbus.c,v 1.24 2000/04/02 19:11:37 mycroft Exp $ */ /* @@ -386,6 +386,7 @@ cardbus_attach_card(struct cardbus_softc *sc) struct device *csc; int no_work_funcs = 0; cardbus_devfunc_t ct; + int i; cc = sc->sc_cc; cf = sc->sc_cf; @@ -399,35 +400,29 @@ cardbus_attach_card(struct cardbus_softc *sc) return (0); } - enable_function(sc, cdstatus, 8); /* XXX use fake function 8 to - keep power on during whole - configuration */ + /* XXX use fake function 8 to keep power on during whole configuration */ + enable_function(sc, cdstatus, 8); function = 0; tag = cardbus_make_tag(cc, cf, sc->sc_bus, sc->sc_device, function); - /* - * Wait until power comes up. Maxmum 500 ms. - */ - { - int i; - for (i = 0; i < 5; ++i) { - id = cardbus_conf_read(cc, cf, tag, CARDBUS_ID_REG); - if (id != 0xffffffff && id != 0) + /* Wait until power comes up. Maximum 500 ms. */ + for (i = 0; i < 5; ++i) { + id = cardbus_conf_read(cc, cf, tag, CARDBUS_ID_REG); + if (id != 0xffffffff && id != 0) + break; + if (cold) { /* before kernel thread invoked */ + delay(100*1000); + } else { /* thread context */ + if (tsleep((void *)sc, PCATCH, "cardbus", + hz/10) != EWOULDBLOCK) { break; - if (cold) { /* before kernel thread invoked */ - delay(100*1000); - } else { /* thread context */ - if (tsleep((void *)sc, PCATCH, "cardbus", - hz/10) != EWOULDBLOCK) { - break; - } } } - if (i == 5) - return (0); } + if (i == 5) + return (0); bhlc = cardbus_conf_read(cc, cf, tag, CARDBUS_BHLC_REG); DPRINTF(("%s bhlc 0x%08x -> ", sc->sc_dev.dv_xname, bhlc)); |