From 24e218260af83b7292524d1581b8dfcf5d3c8c5b Mon Sep 17 00:00:00 2001 From: wollman Date: Wed, 19 Oct 1994 01:59:11 +0000 Subject: Add support for devconf to a large number of device drivers, and do the right thing in dev_goawayall() when kdc_goaway is null. --- sys/kern/kern_devconf.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sys/kern/kern_devconf.c') diff --git a/sys/kern/kern_devconf.c b/sys/kern/kern_devconf.c index f5e74d8..39f728c 100644 --- a/sys/kern/kern_devconf.c +++ b/sys/kern/kern_devconf.c @@ -73,7 +73,8 @@ dev_detach(struct kern_devconf *kdc) /* * NB: the device must do a dev_detach inside its goaway routine, if it - * succeeds. + * succeeds. If no routine is specified, we assume no special treatment is + * required. */ int dev_goawayall(int force) @@ -82,6 +83,12 @@ dev_goawayall(int force) struct kern_devconf *kdc = dc_list; while(kdc) { + if(!kdc->kdc_goaway) { + dev_detach(kdc); + kdc = dc_list; + continue; + } + if(kdc->kdc_goaway(kdc, force)) { rv++; kdc = kdc->kdc_next; -- cgit v1.1