From f2d29ced9107d319f89c930711cbdd39438a2a53 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sun, 6 Apr 2003 16:59:34 +0000 Subject: When encountering an older or unexpected model this driver can not handle, return early in attach() rather than panic. --- sys/arch/sparc/dev/vigra.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/arch/sparc') 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)); -- cgit v1.2.3