summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2004-09-24 20:53:13 +0000
committerJason Wright <jason@cvs.openbsd.org>2004-09-24 20:53:13 +0000
commitd6de8b71336b7da3d24bfd0ad20b0b01e64efe95 (patch)
tree1636197d5f824cb71cabe91766a38a75a73d4585 /sys/arch
parent2e5c92cd70327e660f4b8cc52b1569ed79dbe7b9 (diff)
fix up attachment of zs@fhc
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc64/dev/zs.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/arch/sparc64/dev/zs.c b/sys/arch/sparc64/dev/zs.c
index a5fc66e45d2..7184db54dc2 100644
--- a/sys/arch/sparc64/dev/zs.c
+++ b/sys/arch/sparc64/dev/zs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zs.c,v 1.14 2004/09/23 18:00:58 jason Exp $ */
+/* $OpenBSD: zs.c,v 1.15 2004/09/24 20:53:12 jason Exp $ */
/* $NetBSD: zs.c,v 1.29 2001/05/30 15:24:24 lukem Exp $ */
/*-
@@ -288,9 +288,18 @@ zs_attach_fhc(parent, self, aux)
struct zsc_softc *zsc = (void *) self;
struct fhc_attach_args *fa = aux;
int zs_unit = zsc->zsc_dev.dv_unit;
-
bus_space_handle_t kvaddr;
+ if (fa->fa_nreg < 1) {
+ printf(": no registers\n");
+ return;
+ }
+
+ if (fa->fa_nintr < 1) {
+ printf(": no interrupts\n");
+ return;
+ }
+
if (fhc_bus_map(fa->fa_bustag, fa->fa_reg[0].fbr_slot,
fa->fa_reg[0].fbr_offset, fa->fa_reg[0].fbr_size,
BUS_SPACE_MAP_LINEAR, &kvaddr) != 0) {
@@ -304,10 +313,8 @@ zs_attach_fhc(parent, self, aux)
zsc->zsc_dmatag = NULL;
zsc->zsc_promunit = getpropint(fa->fa_node, "slave", -2);
zsc->zsc_node = fa->fa_node;
- printf("\n");
-#if 0
- zs_attach(zsc, zsaddr[zs_unit], sa->sa_pri);
-#endif
+
+ zs_attach(zsc, zsaddr[zs_unit], fa->fa_intr[0]);
}
/*