diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-07-21 12:39:23 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-07-21 12:39:23 +0000 |
commit | c10da6400937d9d6513689b7191bad09947c0daf (patch) | |
tree | 1ba56694f3b288d69edf092bc3b190239f88639b /sys/dev | |
parent | 2b76a097137bbd6b2fe4b3736128bb4c72db1d2d (diff) |
do resource requirement checking in match(), not attach()
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/isa/mpu_isapnp.c | 4 | ||||
-rw-r--r-- | sys/dev/isa/wdc_isapnp.c | 16 | ||||
-rw-r--r-- | sys/dev/isa/ym_isapnp.c | 10 |
3 files changed, 16 insertions, 14 deletions
diff --git a/sys/dev/isa/mpu_isapnp.c b/sys/dev/isa/mpu_isapnp.c index 465962be56e..7814e27195b 100644 --- a/sys/dev/isa/mpu_isapnp.c +++ b/sys/dev/isa/mpu_isapnp.c @@ -43,6 +43,10 @@ mpu_isapnp_match(parent, match, aux) struct device *parent; void *match, *aux; { + struct isa_attach_args *ipa = aux; + + if (ipa->ipa_nirq != 1) + return 0; return 1; } diff --git a/sys/dev/isa/wdc_isapnp.c b/sys/dev/isa/wdc_isapnp.c index 119d457374a..9793b8e2935 100644 --- a/sys/dev/isa/wdc_isapnp.c +++ b/sys/dev/isa/wdc_isapnp.c @@ -80,6 +80,14 @@ wdc_isapnp_match(parent, match, aux) void *match; void *aux; { + struct isa_attach_args *ipa = aux; + + if (ipa->ipa_nio != 2 || + ipa->ipa_nmem != 0 || + ipa->ipa_nmem32 != 0 || + ipa->ipa_nirq != 1 || + ipa->ipa_ndrq > 1) + return 0; return (1); } @@ -92,14 +100,6 @@ wdc_isapnp_attach(parent, self, aux) struct wdc_isapnp_softc *sc = (void *)self; struct isa_attach_args *ipa = aux; - if (ipa->ipa_nio != 2 || - ipa->ipa_nmem != 0 || - ipa->ipa_nmem32 != 0 || - ipa->ipa_nirq != 1 || - ipa->ipa_ndrq > 1) { - printf(": unexpected configuration\n"); - return; - } sc->wdc_channel.cmd_iot = ipa->ia_iot; sc->wdc_channel.ctl_iot = ipa->ia_iot; diff --git a/sys/dev/isa/ym_isapnp.c b/sys/dev/isa/ym_isapnp.c index 84d3fd4fac3..d5cb93bd9f9 100644 --- a/sys/dev/isa/ym_isapnp.c +++ b/sys/dev/isa/ym_isapnp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ym_isapnp.c,v 1.5 1999/07/20 16:36:06 deraadt Exp $ */ +/* $OpenBSD: ym_isapnp.c,v 1.6 1999/07/21 12:39:22 deraadt Exp $ */ /* @@ -78,7 +78,10 @@ ym_isapnp_match(parent, match, aux) struct device *parent; void *match, *aux; { + struct isa_attach_args *ia = aux; + if (ia->ipa_nio < 5) + return 0; return 1; } @@ -94,11 +97,6 @@ ym_isapnp_attach(parent, self, aux) struct ym_softc *sc = (struct ym_softc *)self; struct isa_attach_args *ia = aux; - if (ia->ipa_nio < 5) { - printf("Insufficient I/O ports... not really attached\n"); - return; - } - sc->sc_iot = ia->ia_iot; sc->sc_ioh = ia->ipa_io[1].h; sc->sc_ic = ia->ia_ic; |