kill some more simple submatch() functions, use config_stdsubmatch()

This commit is contained in:
drochner 2005-08-26 10:13:05 +00:00
parent 3879a20289
commit 096c3e1d2c
8 changed files with 29 additions and 161 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: jensenio.c,v 1.11 2005/08/25 18:35:38 drochner Exp $ */
/* $NetBSD: jensenio.c,v 1.12 2005/08/26 10:13:05 drochner Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -50,7 +50,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: jensenio.c,v 1.11 2005/08/25 18:35:38 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: jensenio.c,v 1.12 2005/08/26 10:13:05 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -93,8 +93,6 @@ CFATTACH_DECL(jensenio, sizeof(struct device),
jensenio_match, jensenio_attach, NULL, NULL);
int jensenio_print(void *, const char *);
int jensenio_submatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
int jensenio_attached;
@ -194,7 +192,7 @@ jensenio_attach(struct device *parent, struct device *self, void *aux)
locs[JENSENIOCF_PORT] = jensenio_devs[i].jd_ioaddr;
(void) config_found_sm_loc(self, "jensenio", locs, &ja,
jensenio_print, jensenio_submatch);
jensenio_print, config_stdsubmatch);
}
/*
@ -221,18 +219,6 @@ jensenio_attach(struct device *parent, struct device *self, void *aux)
(void) config_found_ia(self, "isabus", &ja.ja_isa, isabusprint);
}
int
jensenio_submatch(struct device *parent, struct cfdata *cf,
const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[JENSENIOCF_PORT] != JENSENIOCF_PORT_DEFAULT &&
cf->cf_loc[JENSENIOCF_PORT] != locs[JENSENIOCF_PORT])
return (0);
return (config_match(parent, cf, aux));
}
int
jensenio_print(void *aux, const char *pnp)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: mcbus.c,v 1.16 2005/08/25 18:35:38 drochner Exp $ */
/* $NetBSD: mcbus.c,v 1.17 2005/08/26 10:13:05 drochner Exp $ */
/*
* Copyright (c) 1998 by Matthew Jacob
@ -37,7 +37,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: mcbus.c,v 1.16 2005/08/25 18:35:38 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: mcbus.c,v 1.17 2005/08/26 10:13:05 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -66,8 +66,6 @@ struct mcbus_cpu_busdep mcbus_primary;
static int mcbusmatch __P((struct device *, struct cfdata *, void *));
static void mcbusattach __P((struct device *, struct device *, void *));
static int mcbusprint __P((void *, const char *));
static int mcbussbm __P((struct device *, struct cfdata *,
const locdesc_t *, void *));
static const char *mcbus_node_type_str __P((u_int8_t));
typedef struct {
@ -102,21 +100,6 @@ mcbusprint(aux, cp)
return (UNCONF);
}
static int
mcbussbm(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
const locdesc_t *locs;
void *aux;
{
if (cf->cf_loc[MCBUSCF_MID] != MCBUSCF_MID_DEFAULT &&
cf->cf_loc[MCBUSCF_MID] != locs[MCBUSCF_MID])
return (0);
return (config_match(parent, cf, aux));
}
static int
mcbusmatch(parent, cf, aux)
struct device *parent;
@ -173,7 +156,7 @@ mcbusattach(parent, self, aux)
mbp->mcbus_types[1] = MCBUS_TYPE_MEM;
locs[MCBUSCF_MID] = 1;
(void) config_found_sm_loc(self, "mcbus", locs, &ta,
mcbusprint, mcbussbm);
mcbusprint, config_stdsubmatch);
/*
* Now find PCI busses.
@ -191,7 +174,8 @@ mcbusattach(parent, self, aux)
locs[MCBUSCF_MID] = mid;
if (MCPCIA_EXISTS(ta.ma_mid, ta.ma_gid))
(void) config_found_sm_loc(self, "mcbus", locs, &ta,
mcbusprint, mcbussbm);
mcbusprint,
config_stdsubmatch);
}
#if 0
@ -219,7 +203,7 @@ mcbusattach(parent, self, aux)
mbp->mcbus_types[mid] = MCBUS_TYPE_CPU;
locs[MCBUSCF_MID] = mid;
(void) config_found_sm_loc(self, "mcbus", locs, &ta,
mcbusprint, mcbussbm);
mcbusprint, config_stdsubmatch);
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: sableio.c,v 1.9 2005/08/25 18:35:38 drochner Exp $ */
/* $NetBSD: sableio.c,v 1.10 2005/08/26 10:13:05 drochner Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -55,7 +55,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: sableio.c,v 1.9 2005/08/25 18:35:38 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: sableio.c,v 1.10 2005/08/26 10:13:05 drochner Exp $");
#include "isadma.h"
@ -111,8 +111,6 @@ CFATTACH_DECL(sableio, sizeof(struct sableio_softc),
sableio_match, sableio_attach, NULL, NULL);
int sableio_print(void *, const char *);
int sableio_submatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
struct sableio_softc *sableio_attached;
@ -178,22 +176,10 @@ sableio_attach(struct device *parent, struct device *self, void *aux)
locs[SABLEIOCF_PORT] = sableio_devs[i].sd_ioaddr;
(void) config_found_sm_loc(self, "sableio", locs, &sa,
sableio_print, sableio_submatch);
sableio_print, config_stdsubmatch);
}
}
int
sableio_submatch(struct device *parent, struct cfdata *cf,
const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[SABLEIOCF_PORT] != SABLEIOCF_PORT_DEFAULT &&
cf->cf_loc[SABLEIOCF_PORT] != locs[SABLEIOCF_PORT])
return (0);
return (config_match(parent, cf, aux));
}
int
sableio_print(void *aux, const char *pnp)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: gbus.c,v 1.16 2005/08/25 18:35:38 drochner Exp $ */
/* $NetBSD: gbus.c,v 1.17 2005/08/26 10:13:05 drochner Exp $ */
/*
* Copyright (c) 1997 by Matthew Jacob
@ -37,7 +37,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: gbus.c,v 1.16 2005/08/25 18:35:38 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: gbus.c,v 1.17 2005/08/26 10:13:05 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -68,8 +68,6 @@ CFATTACH_DECL(gbus, sizeof(struct gbus_softc),
gbusmatch, gbusattach, NULL, NULL);
static int gbusprint __P((void *, const char *));
static int gbussubmatch __P((struct device *, struct cfdata *,
const locdesc_t *, void *));
struct gbus_attach_args gbus_children[] = {
{ "zsc", GBUS_DUART0_OFFSET },
@ -133,21 +131,6 @@ gbusattach(parent, self, aux)
for (ga = gbus_children; ga->ga_name != NULL; ga++) {
locs[GBUSCF_OFFSET] = ga->ga_offset;
(void) config_found_sm_loc(self, "gbus", locs, ga,
gbusprint, gbussubmatch);
gbusprint, config_stdsubmatch);
}
}
static int
gbussubmatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
const locdesc_t *locs;
void *aux;
{
if (cf->cf_loc[GBUSCF_OFFSET] != GBUSCF_OFFSET_DEFAULT &&
cf->cf_loc[GBUSCF_OFFSET] != locs[GBUSCF_OFFSET])
return (0);
return (config_match(parent, cf, aux));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: tlsb.c,v 1.29 2005/08/25 18:35:38 drochner Exp $ */
/* $NetBSD: tlsb.c,v 1.30 2005/08/26 10:13:05 drochner Exp $ */
/*
* Copyright (c) 1997 by Matthew Jacob
* NASA AMES Research Center.
@ -39,7 +39,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: tlsb.c,v 1.29 2005/08/25 18:35:38 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: tlsb.c,v 1.30 2005/08/26 10:13:05 drochner Exp $");
#include "opt_multiprocessor.h"
@ -71,8 +71,6 @@ CFATTACH_DECL(tlsb, sizeof (struct device),
extern struct cfdriver tlsb_cd;
static int tlsbprint __P((void *, const char *));
static int tlsbsubmatch __P((struct device *, struct cfdata *,
const locdesc_t *, void *));
static const char *tlsb_node_type_str __P((u_int32_t));
/*
@ -103,24 +101,6 @@ tlsbprint(aux, pnp)
return (UNCONF);
}
static int
tlsbsubmatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
const locdesc_t *locs;
void *aux;
{
if (cf->cf_loc[TLSBCF_NODE] != TLSBCF_NODE_DEFAULT &&
cf->cf_loc[TLSBCF_NODE] != locs[TLSBCF_NODE])
return (0);
if (cf->cf_loc[TLSBCF_OFFSET] != TLSBCF_OFFSET_DEFAULT &&
cf->cf_loc[TLSBCF_OFFSET] != locs[TLSBCF_OFFSET])
return (0);
return (config_match(parent, cf, aux));
}
static int
tlsbmatch(parent, cf, aux)
struct device *parent;
@ -209,7 +189,7 @@ tlsbattach(parent, self, aux)
locs[TLSBCF_OFFSET] = 0; /* XXX unused? */
config_found_sm_loc(self, "tlsb", locs, &ta,
tlsbprint, tlsbsubmatch);
tlsbprint, config_stdsubmatch);
}
/*
* *Now* search for I/O nodes (in descending order)
@ -255,7 +235,7 @@ tlsbattach(parent, self, aux)
locs[TLSBCF_OFFSET] = 0; /* XXX unused? */
config_found_sm_loc(self, "tlsb", locs, &ta,
tlsbprint, tlsbsubmatch);
tlsbprint, config_stdsubmatch);
}
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ioasic_subr.c,v 1.9 2005/08/25 18:35:40 drochner Exp $ */
/* $NetBSD: ioasic_subr.c,v 1.10 2005/08/26 10:14:05 drochner Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -29,7 +29,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ioasic_subr.c,v 1.9 2005/08/25 18:35:40 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: ioasic_subr.c,v 1.10 2005/08/26 10:14:05 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -40,8 +40,6 @@ __KERNEL_RCSID(0, "$NetBSD: ioasic_subr.c,v 1.9 2005/08/25 18:35:40 drochner Exp
#include "locators.h"
int ioasicprint(void *, const char *);
int ioasicsubmatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
int
ioasicprint(aux, pnp)
@ -56,18 +54,6 @@ ioasicprint(aux, pnp)
return (UNCONF);
}
int
ioasicsubmatch(struct device *parent, struct cfdata *cf,
const locdesc_t *locs, void *aux)
{
if ((cf->cf_loc[IOASICCF_OFFSET] != IOASICCF_OFFSET_DEFAULT) &&
(cf->cf_loc[IOASICCF_OFFSET] != locs[IOASICCF_OFFSET]))
return (0);
return (config_match(parent, cf, aux));
}
void
ioasic_attach_devs(sc, ioasic_devs, ioasic_ndevs)
struct ioasic_softc *sc;
@ -91,6 +77,6 @@ ioasic_attach_devs(sc, ioasic_devs, ioasic_ndevs)
/* Tell the autoconfig machinery we've found the hardware. */
locs[IOASICCF_OFFSET] = ioasic_devs[i].iad_offset;
config_found_sm_loc(&sc->sc_dv, "ioasic", locs, &idev,
ioasicprint, ioasicsubmatch);
ioasicprint, config_stdsubmatch);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: tc.c,v 1.41 2005/08/25 18:35:40 drochner Exp $ */
/* $NetBSD: tc.c,v 1.42 2005/08/26 10:14:05 drochner Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tc.c,v 1.41 2005/08/25 18:35:40 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: tc.c,v 1.42 2005/08/26 10:14:05 drochner Exp $");
#include "opt_tcverbose.h"
@ -51,8 +51,6 @@ CFATTACH_DECL(tc, sizeof(struct tc_softc),
extern struct cfdriver tc_cd;
int tcprint(void *, const char *);
int tcsubmatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
void tc_devinfo(const char *, char *, size_t);
int
@ -141,7 +139,7 @@ tcattach(parent, self, aux)
* Attach the device.
*/
config_found_sm_loc(self, "tc", locs, &ta,
tcprint, tcsubmatch);
tcprint, config_stdsubmatch);
}
/*
@ -184,7 +182,7 @@ tcattach(parent, self, aux)
* Attach the device.
*/
config_found_sm_loc(self, "tc", locs, &ta,
tcprint, tcsubmatch);
tcprint, config_stdsubmatch);
}
}
@ -204,24 +202,6 @@ tcprint(aux, pnp)
return (UNCONF);
}
int
tcsubmatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
const locdesc_t *locs;
void *aux;
{
if ((cf->cf_loc[TCCF_SLOT] != TCCF_SLOT_DEFAULT) &&
(cf->cf_loc[TCCF_SLOT] != locs[TCCF_SLOT]))
return 0;
if ((cf->cf_loc[TCCF_OFFSET] != TCCF_OFFSET_DEFAULT) &&
(cf->cf_loc[TCCF_OFFSET] != locs[TCCF_OFFSET]))
return 0;
return (config_match(parent, cf, aux));
}
#define NTC_ROMOFFS 2
static tc_offset_t tc_slot_romoffs[NTC_ROMOFFS] = {

View File

@ -1,4 +1,4 @@
/* $NetBSD: tcds.c,v 1.15 2005/08/25 18:35:40 drochner Exp $ */
/* $NetBSD: tcds.c,v 1.16 2005/08/26 10:14:05 drochner Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tcds.c,v 1.15 2005/08/25 18:35:40 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: tcds.c,v 1.16 2005/08/26 10:14:05 drochner Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -109,8 +109,6 @@ struct tcds_softc {
int tcdsmatch(struct device *, struct cfdata *, void *);
void tcdsattach(struct device *, struct device *, void *);
int tcdsprint(void *, const char *);
int tcdssubmatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
CFATTACH_DECL(tcds, sizeof(struct tcds_softc),
tcdsmatch, tcdsattach, NULL, NULL);
@ -310,7 +308,7 @@ tcdsattach(parent, self, aux)
locs[TCDSCF_CHIP] = i;
config_found_sm_loc(self, "tcds", locs, &tcdsdev,
tcdsprint, tcdssubmatch);
tcdsprint, config_stdsubmatch);
#ifdef __alpha__
/*
* The second SCSI chip isn't present on the baseboard TCDS
@ -323,21 +321,6 @@ tcdsattach(parent, self, aux)
}
}
int
tcdssubmatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
const locdesc_t *locs;
void *aux;
{
if (cf->cf_loc[TCDSCF_CHIP] != TCDSCF_CHIP_DEFAULT &&
cf->cf_loc[TCDSCF_CHIP] != locs[TCDSCF_CHIP])
return (0);
return (config_match(parent, cf, aux));
}
int
tcdsprint(aux, pnp)
void *aux;