Subject: Re: 'wdc0 at isa0...' panics in -current
To: Markus W Kilbinger <kilbi@rad.rwth-aachen.de>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: port-i386
Date: 01/14/2002 22:51:36
--yrj/dFKFPuw6o+aM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

OK, I just commited the fix. Attached is the diff.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
--

--yrj/dFKFPuw6o+aM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="wdc.diff"

Index: wdc.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/ic/wdc.c,v
retrieving revision 1.108
diff -u -r1.108 wdc.c
--- wdc.c	2002/01/13 17:24:28	1.108
+++ wdc.c	2002/01/14 21:50:23
@@ -276,7 +276,7 @@
 			    chp->channel, drive), DEBUG_PROBE);
 			break;
 		}
-		if (chp->wdc->cap & WDC_CAPABILITY_SELECT)
+		if (chp->wdc && chp->wdc->cap & WDC_CAPABILITY_SELECT)
 			chp->wdc->select(chp,drive);
 		bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
 		    WDSD_IBM | (drive << 4));
@@ -800,7 +800,7 @@
 #endif
 	/* wait for BSY to deassert */
 	for (timeout = 0; timeout < WDCNDELAY_RST;timeout++) {
-		if (chp->wdc->cap & WDC_CAPABILITY_SELECT)
+		if (chp->wdc && chp->wdc->cap & WDC_CAPABILITY_SELECT)
 			chp->wdc->select(chp,0);
 		bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
 		    WDSD_IBM); /* master */
@@ -812,7 +812,7 @@
 		cl0 = bus_space_read_1(chp->cmd_iot, chp->cmd_ioh, wd_cyl_lo);
 		ch0 = bus_space_read_1(chp->cmd_iot, chp->cmd_ioh, wd_cyl_hi);
 #endif
-		if (chp->wdc->cap & WDC_CAPABILITY_SELECT)
+		if (chp->wdc && chp->wdc->cap & WDC_CAPABILITY_SELECT)
 			chp->wdc->select(chp,1);
 		bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
 		    WDSD_IBM | 0x10); /* slave */

--yrj/dFKFPuw6o+aM--