From owner-newconfig-jp@jp.freebsd.org  Mon Mar  8 04:07:02 1999
Received: by jaz.jp.freebsd.org (8.9.2+3.1W/8.7.3) id EAA02728;
	Mon, 8 Mar 1999 04:07:02 +0900 (JST)
	(envelope-from owner-newconfig-jp@jp.FreeBSD.org)
Received: from localhost.rr.iij4u.or.jp (h071.p048.iij4u.or.jp [210.130.48.71])
	by jaz.jp.freebsd.org (8.9.2+3.1W/8.7.3) with ESMTP id EAA02723
	for <newconfig-jp@jp.freebsd.org>; Mon, 8 Mar 1999 04:06:58 +0900 (JST)
	(envelope-from bishop@rr.iij4u.or.jp)
Received: from localhost (localhost [127.0.0.1])
	by localhost.rr.iij4u.or.jp (8.9.3+3.1W/3.7W) with ESMTP id EAA20383
	Mon, 8 Mar 1999 04:08:20 +0900 (JST)
	(envelope-from bishop@rr.iij4u.or.jp)
To: newconfig-jp@jp.freebsd.org
From: MAEKAWA Masahide <bishop@rr.iij4u.or.jp>
In-Reply-To: Your message of "Mon, 08 Mar 1999 02:55:35 +0900"
	<19990308025535B.uch@nop.or.jp>
References: <19990308025535B.uch@nop.or.jp>
X-Mailer: Mew version 1.93 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Message-Id: <19990308040820K.bishop@rr.iij4u.or.jp>
Date: Mon, 08 Mar 1999 04:08:20 +0900
X-Dispatcher: imput version 980905(IM100)
Lines: 75
Reply-To: newconfig-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+981115
X-Sequence: newconfig-jp 1299
Subject: [newconfig-jp 1299] Re: CardBus
Errors-To: owner-newconfig-jp@jp.freebsd.org
Sender: owner-newconfig-jp@jp.freebsd.org
X-Originator: bishop@rr.iij4u.or.jp

$BA0@n!w?@8MBg3X$G$9(B.

UCHIYAMA Yasushi <uch@nop.or.jp>$B$5$s$,$$$o$O$k$K(B,
>$B$O$d$+$o$5$s$N(BNetBSD CardBus$B%I%i%$%P$r(BFreeBSD newconfig$B$G(B
>$BF0$+$7$F$_$?$b$N$G$9!#(B
---(snip)
> FreeBSD$BB&$GF0:n$r3NG'$7$?$N$O(B
>RATOC REX-CBS51(RICOH Rx5C478) + 3C575TX/3C575BTX$B$G$9!#(B

$B$3$N%Q%C%A$N(B, sys/kern/subr_autoconf.c $B$H(B sys/sys/device.h $B$NItJ,$@$1$G$b(B
commit $B$7$F$b$$$$$G$9$+(B ?

--- Kobe University (Dept. Science)          maekawa@math.kobe-u.ac.jp
           MAEKAWA Masahide                  gehenna@jp.FreeBSD.org ---
                           Powered By FreeBSD

diff -x CVS -x compile -urN sys.old/kern/subr_autoconf.c sys/kern/subr_autoconf.c
--- sys.old/kern/subr_autoconf.c	Mon Mar  8 03:58:47 1999
+++ sys/kern/subr_autoconf.c	Mon Mar  8 04:00:37 1999
@@ -204,19 +204,18 @@
  * driver function) and attach it, and return true.  If the device was
  * not configured, call the given `print' function and return 0.
  */
-int
+struct device *
 config_found_sm(struct device *parent, void *aux, cfprint_t print,
 		cfmatch_t fn)
 {
 	struct cfdata *cf;
 
 	if ((cf = config_search(fn, parent, aux)) != NULL) {
-		config_attach(parent, cf, aux, print);
-		return (1);
+		return (config_attach(parent, cf, aux, print));
 	}
 	if (print)
 		printf(msgs[(*print)(aux, parent->dv_xname)]);
-	return (0);
+	return (NULL);
 }
 
 /*
@@ -252,7 +251,7 @@
 /*
  * Attach a found device.  Allocates memory for device variables.
  */
-void
+struct device *
 config_attach(struct device *parent,
 	      register struct cfdata *cf,
 	      void *aux,
@@ -354,6 +353,7 @@
 		}
 	(*ca->ca_attach)(parent, dev, aux);
 	config_process_deferred_children(dev);
+	return (dev);
 }
 
 /*
diff -x CVS -x compile -urN sys.old/sys/device.h sys/sys/device.h
--- sys.old/sys/device.h	Mon Mar  8 03:59:13 1999
+++ sys/sys/device.h	Mon Mar  8 04:01:05 1999
@@ -185,10 +185,10 @@
 void config_init __P((void));
 struct cfdata *config_search __P((cfmatch_t, struct device *, void *));
 struct cfdata *config_rootsearch __P((cfmatch_t, char *, void *));
-int config_found_sm __P((struct device *, void *, cfprint_t, cfmatch_t));
+struct device *config_found_sm __P((struct device *, void *, cfprint_t, cfmatch_t));
 #define config_found(d, a, p)	config_found_sm((d), (a), (p), NULL)
 int config_rootfound __P((char *, void *));
-void config_attach __P((struct device *, struct cfdata *, void *, cfprint_t));
+struct device *config_attach __P((struct device *, struct cfdata *, void *, cfprint_t));
 int config_detach __P((struct device *, int));
 int config_activate __P((struct device *));
 int config_deactivate __P((struct device *));
