CFATTACH_DECL(..., sizeof(struct device), -> CFATTACH_DECL_NEW(..., 0

struct device * -> device_t
struct cfdata * -> cfdata_t
use bool when appropriate
This commit is contained in:
matt 2011-06-06 16:52:18 +00:00
parent 5c3b0cfd8f
commit 2d01485274
4 changed files with 44 additions and 49 deletions

View File

@ -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 @@ u_int bootdev;
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 @@ mainbusattach(struct device *parent, struct device *self, void *aux)
}
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)

View File

@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.53 2009/11/01 01:51:35 snj Exp $");
/*
* 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 @@ extern char *adbHardwareDescr[];
/*
* 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 @@ adbattach(struct device *parent, struct device *self, void *aux)
}
void
adb_config_interrupts(struct device *self)
adb_config_interrupts(device_t self)
{
ADBDataBlock adbdata;
struct adb_attach_args aa_args;

View File

@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.24 2008/04/28 20:23:27 martin Exp $");
#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 @@ obio_print(void *args, const char *name)
}
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;

View File

@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: intio.c,v 1.13 2008/04/28 20:23:30 martin Exp $");
#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 @@ struct cfdriver intio_cd = {
};
#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 @@ intiomatch(struct device *parent, struct cfdata *match, void *aux)
}
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 @@ intioattach(struct device *parent, struct device *self, void *aux)
/* Search for and attach children. */
config_search_ia(intiosearch, self, "intio", aux);
intio_attached = 1;
intio_attached = true;
}
int
@ -96,8 +95,7 @@ intioprint(void *aux, const char *pnp)
}
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;