Module Name:    src
Committed By:   matt
Date:           Mon Jun  6 16:52:18 UTC 2011

Modified Files:
        src/sys/arch/cesfic/cesfic: autoconf.c
        src/sys/arch/mac68k/dev: adb.c
        src/sys/arch/mac68k/obio: obio.c
        src/sys/arch/next68k/dev: intio.c

Log Message:
CFATTACH_DECL(..., sizeof(struct device), -> CFATTACH_DECL_NEW(..., 0
struct device * -> device_t
struct cfdata * -> cfdata_t
use bool when appropriate


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/cesfic/cesfic/autoconf.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/mac68k/dev/adb.c
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/mac68k/obio/obio.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/next68k/dev/intio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/cesfic/cesfic/autoconf.c
diff -u src/sys/arch/cesfic/cesfic/autoconf.c:1.24 src/sys/arch/cesfic/cesfic/autoconf.c:1.25
--- src/sys/arch/cesfic/cesfic/autoconf.c:1.24	Sat Nov  7 07:27:42 2009
+++ src/sys/arch/cesfic/cesfic/autoconf.c	Mon Jun  6 16:52:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.24 2009/11/07 07:27:42 cegger Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.25 2011/06/06 16:52:18 matt Exp $	*/
 
 /*
  * Copyright (c) 1997, 1999
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.24 2009/11/07 07:27:42 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.25 2011/06/06 16:52:18 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -57,29 +57,28 @@
 
 struct evcnt evcnt_fpsp_unimp, evcnt_fpsp_unsupp;
 
-int	mainbusmatch(struct device *, struct cfdata *, void *);
-void	mainbusattach(struct device *, struct device *, void *);
-int	mainbussearch(struct device *, struct cfdata *,
-			   const int *, void *);
+int	mainbusmatch(device_t, cfdata_t, void *);
+void	mainbusattach(device_t, device_t, void *);
+int	mainbussearch(device_t, cfdata_t, const int *, void *);
 
-CFATTACH_DECL(mainbus, sizeof(struct device),
+CFATTACH_DECL_NEW(mainbus, 0,
     mainbusmatch, mainbusattach, NULL, NULL);
 
 int
-mainbusmatch(struct device *parent, struct cfdata *match, void *aux)
+mainbusmatch(device_t parent, cfdata_t match, void *aux)
 {
-	static int mainbus_matched = 0;
+	static bool mainbus_matched;
 
 	/* Allow only one instance. */
 	if (mainbus_matched)
 		return (0);
 
-	mainbus_matched = 1;
+	mainbus_matched = true;
 	return (1);
 }
 
 void
-mainbusattach(struct device *parent, struct device *self, void *aux)
+mainbusattach(device_t parent, device_t self, void *aux)
 {
 
 	printf("\n");
@@ -94,7 +93,7 @@
 }
 
 int
-mainbussearch(struct device *parent, struct cfdata *cf, const int *ldesc, void *aux)
+mainbussearch(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
 {
 
 	if (config_match(parent, cf, NULL) > 0)

Index: src/sys/arch/mac68k/dev/adb.c
diff -u src/sys/arch/mac68k/dev/adb.c:1.53 src/sys/arch/mac68k/dev/adb.c:1.54
--- src/sys/arch/mac68k/dev/adb.c:1.53	Sun Nov  1 01:51:35 2009
+++ src/sys/arch/mac68k/dev/adb.c	Mon Jun  6 16:52:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb.c,v 1.53 2009/11/01 01:51:35 snj Exp $	*/
+/*	$NetBSD: adb.c,v 1.54 2011/06/06 16:52:18 matt Exp $	*/
 
 /*
  * Copyright (C) 1994	Bradley A. Grantham
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.53 2009/11/01 01:51:35 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.54 2011/06/06 16:52:18 matt Exp $");
 
 #include "opt_adb.h"
 
@@ -52,10 +52,10 @@
 /*
  * Function declarations.
  */
-static int	adbmatch(struct device *, struct cfdata *, void *);
-static void	adbattach(struct device *, struct device *, void *);
+static int	adbmatch(device_t, cfdata_t, void *);
+static void	adbattach(device_t, device_t, void *);
 static int	adbprint(void *, const char *);
-void		adb_config_interrupts(struct device *);
+void		adb_config_interrupts(device_t);
 
 extern void	adb_jadbproc(void);
 
@@ -74,24 +74,24 @@
 /*
  * Driver definition.
  */
-CFATTACH_DECL(adb, sizeof(struct device),
+CFATTACH_DECL_NEW(adb, 0,
     adbmatch, adbattach, NULL, NULL);
 
 static int
-adbmatch(struct device *parent, struct cfdata *cf, void *aux)
+adbmatch(device_t parent, cfdata_t cf, void *aux)
 {
-	static int adb_matched = 0;
+	static bool adb_matched;
 
 	/* Allow only one instance. */
 	if (adb_matched)
 		return (0);
 
-	adb_matched = 1;
+	adb_matched = true;
 	return (1);
 }
 
 static void
-adbattach(struct device *parent, struct device *self, void *aux)
+adbattach(device_t parent, device_t self, void *aux)
 {
 
 	adb_softintr_cookie = softint_establish(SOFTINT_SERIAL,
@@ -105,7 +105,7 @@
 }
 
 void
-adb_config_interrupts(struct device *self)
+adb_config_interrupts(device_t self)
 {
 	ADBDataBlock adbdata;
 	struct adb_attach_args aa_args;

Index: src/sys/arch/mac68k/obio/obio.c
diff -u src/sys/arch/mac68k/obio/obio.c:1.24 src/sys/arch/mac68k/obio/obio.c:1.25
--- src/sys/arch/mac68k/obio/obio.c:1.24	Mon Apr 28 20:23:27 2008
+++ src/sys/arch/mac68k/obio/obio.c	Mon Jun  6 16:52:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: obio.c,v 1.24 2008/04/28 20:23:27 martin Exp $	*/
+/*	$NetBSD: obio.c,v 1.25 2011/06/06 16:52:18 matt Exp $	*/
 
 /*
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.24 2008/04/28 20:23:27 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.25 2011/06/06 16:52:18 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -42,30 +42,29 @@
 
 #include <mac68k/obio/obiovar.h>
 
-static int	obio_match(struct device *, struct cfdata *, void *);
-static void	obio_attach(struct device *, struct device *, void *);
+static int	obio_match(device_t, cfdata_t, void *);
+static void	obio_attach(device_t, device_t, void *);
 static int	obio_print(void *, const char *);
-static int	obio_search(struct device *, struct cfdata *,
-			    const int *, void *);
+static int	obio_search(device_t, cfdata_t, const int *, void *);
 
-CFATTACH_DECL(obio, sizeof(struct device),
+CFATTACH_DECL_NEW(obio, 0,
     obio_match, obio_attach, NULL, NULL);
 
 static int
-obio_match(struct device *parent, struct cfdata *cf, void *aux)
+obio_match(device_t parent, cfdata_t cf, void *aux)
 {
-	static int obio_matched = 0;
+	static bool obio_matched;
 
 	/* Allow only one instance. */
 	if (obio_matched)
 		return (0);
 
-	obio_matched = 1;
+	obio_matched = true;
 	return (1);
 }
 
 static void
-obio_attach(struct device *parent, struct device *self, void *aux)
+obio_attach(device_t parent, device_t self, void *aux)
 {
 	printf("\n");
 
@@ -85,8 +84,7 @@
 }
 
 int
-obio_search(struct device *parent, struct cfdata *cf,
-	    const int *ldesc, void *aux)
+obio_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
 {
 	struct mainbus_attach_args *mba = (struct mainbus_attach_args *) aux;
 	struct obio_attach_args oa;

Index: src/sys/arch/next68k/dev/intio.c
diff -u src/sys/arch/next68k/dev/intio.c:1.13 src/sys/arch/next68k/dev/intio.c:1.14
--- src/sys/arch/next68k/dev/intio.c:1.13	Mon Apr 28 20:23:30 2008
+++ src/sys/arch/next68k/dev/intio.c	Mon Jun  6 16:52:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: intio.c,v 1.13 2008/04/28 20:23:30 martin Exp $	*/
+/*	$NetBSD: intio.c,v 1.14 2011/06/06 16:52:18 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intio.c,v 1.13 2008/04/28 20:23:30 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intio.c,v 1.14 2011/06/06 16:52:18 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -45,13 +45,12 @@
 
 #include <next68k/dev/intiovar.h>
 
-int	intiomatch(struct device *, struct cfdata *, void *);
-void	intioattach(struct device *, struct device *, void *);
+int	intiomatch(device_t, cfdata_t, void *);
+void	intioattach(device_t, device_t, void *);
 int	intioprint(void *, const char *);
-int	intiosearch(struct device *, struct cfdata *,
-		    const int *, void *);
+int	intiosearch(device_t, cfdata_t, const int *, void *);
 
-CFATTACH_DECL(intio, sizeof(struct device),
+CFATTACH_DECL_NEW(intio, 0,
     intiomatch, intioattach, NULL, NULL);
 
 #if 0
@@ -60,10 +59,10 @@
 };
 #endif
 
-static int intio_attached = 0;
+static bool intio_attached;
 
 int
-intiomatch(struct device *parent, struct cfdata *match, void *aux)
+intiomatch(device_t parent, cfdata_t match, void *aux)
 {
 	/* Allow only one instance. */
 	if (intio_attached)
@@ -73,7 +72,7 @@
 }
 
 void
-intioattach(struct device *parent, struct device *self, void *aux)
+intioattach(device_t parent, device_t self, void *aux)
 {
 
 	printf("\n");
@@ -81,7 +80,7 @@
 	/* Search for and attach children. */
 	config_search_ia(intiosearch, self, "intio", aux);
 
-	intio_attached = 1;
+	intio_attached = true;
 }
 
 int
@@ -96,8 +95,7 @@
 }
 
 int
-intiosearch(struct device *parent, struct cfdata *cf,
-	    const int *ldesc, void *aux)
+intiosearch(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
 {
 	struct mainbus_attach_args *mba = (struct mainbus_attach_args *) aux;
 	struct intio_attach_args ia;

Reply via email to