summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/vigra.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2003-04-06 16:59:34 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2003-04-06 16:59:34 +0000
commitf2d29ced9107d319f89c930711cbdd39438a2a53 (patch)
tree01e954daa4593cb9ca173b15f2b0e12d419219da /sys/arch/sparc/dev/vigra.c
parent28ba628961519d495cf13b25437f1617b422083c (diff)
When encountering an older or unexpected model this driver can not handle,
return early in attach() rather than panic.
Diffstat (limited to 'sys/arch/sparc/dev/vigra.c')
-rw-r--r--sys/arch/sparc/dev/vigra.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/sparc/dev/vigra.c b/sys/arch/sparc/dev/vigra.c
index 822113aee22..31ab54e64c9 100644
--- a/sys/arch/sparc/dev/vigra.c
+++ b/sys/arch/sparc/dev/vigra.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vigra.c,v 1.5 2002/11/06 21:06:20 miod Exp $ */
+/* $OpenBSD: vigra.c,v 1.6 2003/04/06 16:59:33 miod Exp $ */
/*
* Copyright (c) 2002 Miodrag Vallat. All rights reserved.
@@ -206,9 +206,11 @@ vigraattach(parent, self, args)
isconsole = node == fbnode;
- if (ca->ca_ra.ra_nreg < VIGRA_NREG)
- panic("expected %d registers, got %d",
- VIGRA_NREG, ca->ca_ra.ra_nreg);
+ if (ca->ca_ra.ra_nreg < VIGRA_NREG) {
+ printf("\n%s: expected %d registers, got %d",
+ self->dv_xname, VIGRA_NREG, ca->ca_ra.ra_nreg);
+ return;
+ }
sc->sc_regs = mapiodev(&ca->ca_ra.ra_reg[VIGRA_REG_G300], 0,
sizeof(*sc->sc_regs));