Use CFATTACH_DECL().

This commit is contained in:
thorpej 2002-10-01 01:25:25 +00:00
parent ab29a17b64
commit 90c48d2563
12 changed files with 59 additions and 82 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhub.c,v 1.60 2002/09/27 20:42:00 thorpej Exp $ */
/* $NetBSD: uhub.c,v 1.61 2002/10/01 01:25:25 thorpej Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */
/*
@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.60 2002/09/27 20:42:00 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.61 2002/10/01 01:25:25 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -102,10 +102,8 @@ Static bus_child_detached_t uhub_child_detached;
USB_DECLARE_DRIVER(uhub);
/* Create the driver instance for the hub connected to hub case */
const struct cfattach uhub_uhub_ca = {
sizeof(struct uhub_softc), uhub_match, uhub_attach,
uhub_detach, uhub_activate
};
CFATTACH_DECL(uhub_uhub, sizeof(struct uhub_softc),
uhub_match, uhub_attach, uhub_detach, uhub_activate)
#elif defined(__FreeBSD__)
USB_DECLARE_DRIVER_INIT(uhub,
DEVMETHOD(bus_child_detached, uhub_child_detached));

View File

@ -1,5 +1,5 @@
/* $OpenBSD: usb_port.h,v 1.18 2000/09/06 22:42:10 rahnds Exp $ */
/* $NetBSD: usb_port.h,v 1.57 2002/09/27 20:42:01 thorpej Exp $ */
/* $NetBSD: usb_port.h,v 1.58 2002/10/01 01:25:26 thorpej Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_port.h,v 1.21 1999/11/17 22:33:47 n_hibma Exp $ */
/*
@ -125,6 +125,7 @@ typedef int usb_malloc_type;
#define logprintf printf
#define USB_DNAME(dname) dname
#define USB_DECLARE_DRIVER(dname) \
int __CONCAT(dname,_match)(struct device *, struct cfdata *, void *); \
void __CONCAT(dname,_attach)(struct device *, struct device *, void *); \
@ -133,13 +134,12 @@ int __CONCAT(dname,_activate)(struct device *, enum devact); \
\
extern struct cfdriver __CONCAT(dname,_cd); \
\
const struct cfattach __CONCAT(dname,_ca) = { \
sizeof(struct __CONCAT(dname,_softc)), \
__CONCAT(dname,_match), \
__CONCAT(dname,_attach), \
__CONCAT(dname,_detach), \
__CONCAT(dname,_activate), \
}
CFATTACH_DECL(USB_DNAME(dname), \
sizeof(struct ___CONCAT(dname,_softc)), \
___CONCAT(dname,_match), \
___CONCAT(dname,_attach), \
___CONCAT(dname,_detach), \
___CONCAT(dname,_activate))
#define USB_MATCH(dname) \
int __CONCAT(dname,_match)(struct device *parent, struct cfdata *match, void *aux)

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ie_vme.c,v 1.15 2002/09/27 20:42:01 thorpej Exp $ */
/* $NetBSD: if_ie_vme.c,v 1.16 2002/10/01 01:28:03 thorpej Exp $ */
/*-
* Copyright (c) 1995 Charles D. Cranor
@ -145,7 +145,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ie_vme.c,v 1.15 2002/09/27 20:42:01 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ie_vme.c,v 1.16 2002/10/01 01:28:03 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -244,9 +244,8 @@ struct ie_vme_softc {
bus_space_handle_t ievh;
};
const struct cfattach ie_vme_ca = {
sizeof(struct ie_vme_softc), ie_vme_match, ie_vme_attach
};
CFATTACH_DECL(ie_vme, sizeof(struct ie_vme_softc),
ie_vme_match, ie_vme_attach, NULL, NULL)
#define read_iev(sc, reg) \
bus_space_read_2(sc->ievt, sc->ievh, offsetof(struct ievme, reg))

View File

@ -1,4 +1,4 @@
/* $NetBSD: sc_vme.c,v 1.6 2002/09/27 20:42:02 thorpej Exp $ */
/* $NetBSD: sc_vme.c,v 1.7 2002/10/01 01:28:03 thorpej Exp $ */
/*-
* Copyright (c) 1996,2000,2001 The NetBSD Foundation, Inc.
@ -69,7 +69,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sc_vme.c,v 1.6 2002/09/27 20:42:02 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: sc_vme.c,v 1.7 2002/10/01 01:28:03 thorpej Exp $");
#include "opt_ddb.h"
@ -117,9 +117,8 @@ static void sc_vme_attach __P((struct device *, struct device *, void *));
static int sc_vme_intr __P((void *));
/* Auto-configuration glue. */
const struct cfattach sc_vme_ca = {
sizeof(struct sunscpal_softc), sc_vme_match, sc_vme_attach
};
CFATTACH_DECL(sc_vme, sizeof(struct sunscpal_softc),
sc_vme_match, sc_vme_attach, NULL, NULL)
static int
sc_vme_match(parent, cf, aux)

View File

@ -1,4 +1,4 @@
/* $NetBSD: si.c,v 1.10 2002/09/27 20:42:03 thorpej Exp $ */
/* $NetBSD: si.c,v 1.11 2002/10/01 01:28:03 thorpej Exp $ */
/*-
* Copyright (c) 1996,2000 The NetBSD Foundation, Inc.
@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: si.c,v 1.10 2002/09/27 20:42:03 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: si.c,v 1.11 2002/10/01 01:28:03 thorpej Exp $");
#include "opt_ddb.h"
@ -200,9 +200,8 @@ void si_intr_off __P((struct ncr5380_softc *));
/* Auto-configuration glue. */
const struct cfattach si_ca = {
sizeof(struct si_softc), si_match, si_attach
};
CFATTACH_DECL(si, sizeof(struct si_softc),
si_match, si_attach, NULL, NULL)
static int
si_match(parent, cf, aux)

View File

@ -1,4 +1,4 @@
/* $NetBSD: vme.c,v 1.7 2002/09/27 20:42:03 thorpej Exp $ */
/* $NetBSD: vme.c,v 1.8 2002/10/01 01:28:03 thorpej Exp $ */
/*
* Copyright (c) 1999
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vme.c,v 1.7 2002/09/27 20:42:03 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: vme.c,v 1.8 2002/10/01 01:28:03 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -57,9 +57,8 @@ int vmedetach __P((struct device*));
#define VME_NUMCFRANGES 3 /* cf. "files.vme" */
const struct cfattach vme_ca = {
sizeof(struct vmebus_softc), vmematch, vmeattach,
};
CFATTACH_DECL(vme, sizeof(struct vmebus_softc),
vmematch, vmeattach, NULL, NULL)
const struct cfattach vme_slv_ca = {
0 /* never used */

View File

@ -1,4 +1,4 @@
/* $NetBSD: xd.c,v 1.43 2002/09/27 20:42:04 thorpej Exp $ */
/* $NetBSD: xd.c,v 1.44 2002/10/01 01:28:03 thorpej Exp $ */
/*
*
@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.43 2002/09/27 20:42:04 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.44 2002/10/01 01:28:03 thorpej Exp $");
#undef XDC_DEBUG /* full debug */
#define XDC_DIAG /* extra sanity checks */
@ -278,14 +278,11 @@ void xdc_md_setup()
* cfattach's: device driver interface to autoconfig
*/
const struct cfattach xdc_ca = {
sizeof(struct xdc_softc), xdcmatch, xdcattach
};
CFATTACH_DECL(xdc, sizeof(struct xdc_softc),
xdcmatch, xdcattach, NULL, NULL)
const struct cfattach xd_ca = {
sizeof(struct xd_softc), xdmatch, xdattach
};
CFATTACH_DECL(xd, sizeof(struct xd_softc),
xdmatch, xdattach, NULL, NULL)
extern struct cfdriver xd_cd;

View File

@ -1,4 +1,4 @@
/* $NetBSD: xy.c,v 1.43 2002/09/27 20:42:05 thorpej Exp $ */
/* $NetBSD: xy.c,v 1.44 2002/10/01 01:28:04 thorpej Exp $ */
/*
*
@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.43 2002/09/27 20:42:05 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.44 2002/10/01 01:28:04 thorpej Exp $");
#undef XYC_DEBUG /* full debug */
#undef XYC_DIAG /* extra sanity checks */
@ -193,13 +193,11 @@ int xygetdisklabel __P((struct xy_softc *, void *));
* cfattach's: device driver interface to autoconfig
*/
const struct cfattach xyc_ca = {
sizeof(struct xyc_softc), xycmatch, xycattach
};
CFATTACH_DECL(xyc, sizeof(struct xyc_softc),
xycmatch, xycattach, NULL, NULL)
const struct cfattach xy_ca = {
sizeof(struct xy_softc), xymatch, xyattach
};
CFATTACH_DECL(xy, sizeof(struct xy_softc),
xymatch, xyattach, NULL, NULL)
extern struct cfdriver xy_cd;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsdisplay.c,v 1.67 2002/09/27 20:42:08 thorpej Exp $ */
/* $NetBSD: wsdisplay.c,v 1.68 2002/10/01 01:30:00 thorpej Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.67 2002/09/27 20:42:08 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.68 2002/10/01 01:30:00 thorpej Exp $");
#include "opt_wsdisplay_compat.h"
#include "opt_compat_netbsd.h"
@ -143,17 +143,11 @@ static void wsdisplay_emul_attach(struct device *, struct device *, void *);
static int wsdisplay_noemul_match(struct device *, struct cfdata *, void *);
static void wsdisplay_noemul_attach(struct device *, struct device *, void *);
const struct cfattach wsdisplay_emul_ca = {
sizeof (struct wsdisplay_softc),
wsdisplay_emul_match,
wsdisplay_emul_attach,
};
const struct cfattach wsdisplay_noemul_ca = {
sizeof (struct wsdisplay_softc),
wsdisplay_noemul_match,
wsdisplay_noemul_attach,
};
CFATTACH_DECL(wsdisplay_emul, sizeof (struct wsdisplay_softc),
wsdisplay_emul_match, wsdisplay_emul_attach, NULL, NULL)
CFATTACH_DECL(wsdisplay_noemul, sizeof (struct wsdisplay_softc),
wsdisplay_noemul_match, wsdisplay_noemul_attach, NULL, NULL)
dev_type_open(wsdisplayopen);
dev_type_close(wsdisplayclose);

View File

@ -1,4 +1,4 @@
/* $NetBSD: wskbd.c,v 1.63 2002/09/27 20:42:09 thorpej Exp $ */
/* $NetBSD: wskbd.c,v 1.64 2002/10/01 01:30:00 thorpej Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.63 2002/09/27 20:42:09 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.64 2002/10/01 01:30:00 thorpej Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -236,10 +236,8 @@ static int wskbd_mux_close(struct wsevsrc *);
static int wskbd_do_open(struct wskbd_softc *, struct wseventvar *);
static int wskbd_do_ioctl(struct device *, u_long, caddr_t, int, struct proc *);
const struct cfattach wskbd_ca = {
sizeof (struct wskbd_softc), wskbd_match, wskbd_attach,
wskbd_detach, wskbd_activate
};
CFATTACH_DECL(wskbd, sizeof (struct wskbd_softc),
wskbd_match, wskbd_attach, wskbd_detach, wskbd_activate)
extern struct cfdriver wskbd_cd;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsmouse.c,v 1.25 2002/09/27 20:42:10 thorpej Exp $ */
/* $NetBSD: wsmouse.c,v 1.26 2002/10/01 01:30:00 thorpej Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.25 2002/09/27 20:42:10 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.26 2002/10/01 01:30:00 thorpej Exp $");
#include "wsmouse.h"
#include "wsdisplay.h"
@ -152,10 +152,8 @@ static int wsmousedoioctl(struct device *, u_long, caddr_t, int, struct proc *)
static int wsmousedoopen(struct wsmouse_softc *, struct wseventvar *);
const struct cfattach wsmouse_ca = {
sizeof (struct wsmouse_softc), wsmouse_match, wsmouse_attach,
wsmouse_detach, wsmouse_activate
};
CFATTACH_DECL(wsmouse, sizeof (struct wsmouse_softc),
wsmouse_match, wsmouse_attach, wsmouse_detach, wsmouse_activate)
#if NWSMOUSE > 0
extern struct cfdriver wsmouse_cd;

View File

@ -1,4 +1,4 @@
/* $NetBSD: bi_xmi.c,v 1.3 2002/09/27 20:42:11 thorpej Exp $ */
/* $NetBSD: bi_xmi.c,v 1.4 2002/10/01 01:33:44 thorpej Exp $ */
/*
* Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bi_xmi.c,v 1.3 2002/09/27 20:42:11 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: bi_xmi.c,v 1.4 2002/10/01 01:33:44 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -83,7 +83,5 @@ bi_xmi_attach(struct device *parent, struct device *self, void *aux)
bi_attach(sc);
}
const struct cfattach bi_xmi_ca = {
sizeof(struct bi_softc), bi_xmi_match, bi_xmi_attach
};
CFATTACH_DECL(bi_xmi, sizeof(struct bi_softc),
bi_xmi_match, bi_xmi_attach, NULL, NULL)