kill a number of autoconf submatch functions which follow the

standard scheme:
if (<configured> != <wildcard> && <configured> != <real>)
	then fail
else
	ask device match function

This is handled by config_stdsubmatch() now.
This commit is contained in:
drochner 2005-08-25 22:33:18 +00:00
parent 90c378642f
commit e6a178f21f
18 changed files with 61 additions and 357 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pnpbios.c,v 1.50 2005/08/25 18:35:38 drochner Exp $ */
/* $NetBSD: pnpbios.c,v 1.51 2005/08/25 22:33:18 drochner Exp $ */
/*
* Copyright (c) 2000 Jason R. Thorpe. All rights reserved.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pnpbios.c,v 1.50 2005/08/25 18:35:38 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: pnpbios.c,v 1.51 2005/08/25 22:33:18 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -140,8 +140,6 @@ static int pnpbios_attachnode(struct pnpbios_softc *,
static int pnp_scan(const u_int8_t **, size_t,
struct pnpresources *, int);
static int pnpbios_submatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
extern int pnpbioscall(int);
static void pnpbios_enumerate(struct pnpbios_softc *);
@ -766,18 +764,6 @@ pnpbios_print_devres(struct device *dev, struct pnpbiosdev_attach_args *aa)
printf("\n");
}
static int
pnpbios_submatch(struct device *parent, struct cfdata *match,
const locdesc_t *locs, void *aux)
{
if (match->cf_loc[PNPBIOSCF_INDEX] != PNPBIOSCF_INDEX_DEFAULT &&
match->cf_loc[PNPBIOSCF_INDEX] != locs[PNPBIOSCF_INDEX])
return (0);
return (config_match(parent, match, aux));
}
static int
pnpbios_attachchild(struct pnpbios_softc *sc,
struct pnpbiosdev_attach_args *aa, int matchonly)
@ -787,11 +773,11 @@ pnpbios_attachchild(struct pnpbios_softc *sc,
locs[PNPBIOSCF_INDEX] = aa->idx;
if (matchonly)
return (config_search_loc(pnpbios_submatch, (struct device *)sc,
return (config_search_loc(config_stdsubmatch, (struct device *)sc,
"pnpbios", locs, aa) != NULL);
else
return (config_found_sm_loc((struct device *)sc, "pnpbios",
locs, aa, pnpbios_print, pnpbios_submatch)
locs, aa, pnpbios_print, config_stdsubmatch)
!= NULL);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ata_raid.c,v 1.15 2005/08/25 18:35:39 drochner Exp $ */
/* $NetBSD: ata_raid.c,v 1.16 2005/08/25 22:33:18 drochner Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.15 2005/08/25 18:35:39 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.16 2005/08/25 22:33:18 drochner Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -76,9 +76,6 @@ static int ataraid_match(struct device *, struct cfdata *, void *);
static void ataraid_attach(struct device *, struct device *, void *);
static int ataraid_print(void *, const char *);
static int ataraid_submatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
static int ata_raid_finalize(struct device *);
ataraid_array_info_list_t ataraid_array_info_list =
@ -206,7 +203,7 @@ ataraid_attach(struct device *parent, struct device *self, void *aux)
locs[ATARAIDCF_UNIT] = aai->aai_arrayno;
config_found_sm_loc(self, "ataraid", locs, aai,
ataraid_print, ataraid_submatch);
ataraid_print, config_stdsubmatch);
}
}
@ -226,27 +223,6 @@ ataraid_print(void *aux, const char *pnp)
return (UNCONF);
}
/*
* ataraid_submatch:
*
* Submatch routine for ATA RAID logical disks.
*/
static int
ataraid_submatch(struct device *parent, struct cfdata *cf,
const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[ATARAIDCF_VENDTYPE] != ATARAIDCF_VENDTYPE_DEFAULT &&
cf->cf_loc[ATARAIDCF_VENDTYPE] != locs[ATARAIDCF_VENDTYPE])
return (0);
if (cf->cf_loc[ATARAIDCF_UNIT] != ATARAIDCF_UNIT_DEFAULT &&
cf->cf_loc[ATARAIDCF_UNIT] != locs[ATARAIDCF_UNIT])
return (0);
return (config_match(parent, cf, aux));
}
/*
* ata_raid_check_component:
*

View File

@ -1,4 +1,4 @@
/* $NetBSD: cardbus.c,v 1.62 2005/08/25 18:35:39 drochner Exp $ */
/* $NetBSD: cardbus.c,v 1.63 2005/08/25 22:33:18 drochner Exp $ */
/*
* Copyright (c) 1997, 1998, 1999 and 2000
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cardbus.c,v 1.62 2005/08/25 18:35:39 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: cardbus.c,v 1.63 2005/08/25 22:33:18 drochner Exp $");
#include "opt_cardbus.h"
@ -73,8 +73,6 @@ STATIC void cardbusattach(struct device *, struct device *, void *);
STATIC int cardbusmatch(struct device *, struct cfdata *, void *);
int cardbus_rescan(struct device *, const char *, const int *);
void cardbus_childdetached(struct device *, struct device *);
static int cardbussubmatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
static int cardbusprint(void *, const char *);
typedef void (*tuple_decode_func)(u_int8_t*, int, void*);
@ -595,7 +593,7 @@ cardbus_rescan(struct device *self, const char *ifattr, const int *locators)
locs[CARDBUSCF_FUNCTION] = function;
if ((csc = config_found_sm_loc((void *)sc, "cardbus", locs,
&ca, cardbusprint, cardbussubmatch)) == NULL) {
&ca, cardbusprint, config_stdsubmatch)) == NULL) {
/* do not match */
disable_function(sc, function);
sc->sc_funcs[function] = NULL;
@ -614,24 +612,6 @@ cardbus_rescan(struct device *self, const char *ifattr, const int *locators)
return (0);
}
static int
cardbussubmatch(struct device *parent, struct cfdata *cf,
const locdesc_t *locs, void *aux)
{
/* ldesc->locs[CARDBUSCF_DEV] is always 0 */
if (cf->cf_loc[CARDBUSCF_DEV] != CARDBUSCF_DEV_DEFAULT &&
cf->cf_loc[CARDBUSCF_DEV] != locs[CARDBUSCF_DEV]) {
return (0);
}
if (cf->cf_loc[CARDBUSCF_FUNCTION] != CARDBUSCF_FUNCTION_DEFAULT &&
cf->cf_loc[CARDBUSCF_FUNCTION] != locs[CARDBUSCF_FUNCTION]) {
return (0);
}
return (config_match(parent, cf, aux));
}
static int
cardbusprint(void *aux, const char *pnp)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: eisa.c,v 1.37 2005/08/25 18:35:39 drochner Exp $ */
/* $NetBSD: eisa.c,v 1.38 2005/08/25 22:33:18 drochner Exp $ */
/*
* Copyright (c) 1995, 1996 Christopher G. Demetriou
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: eisa.c,v 1.37 2005/08/25 18:35:39 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: eisa.c,v 1.38 2005/08/25 22:33:18 drochner Exp $");
#include "opt_eisaverbose.h"
@ -61,8 +61,6 @@ static void eisaattach(struct device *, struct device *, void *);
CFATTACH_DECL(eisa, sizeof(struct device),
eisamatch, eisaattach, NULL, NULL);
static int eisasubmatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
static int eisaprint(void *, const char *);
static void eisa_devinfo(const char *, char *, size_t);
@ -88,17 +86,6 @@ eisaprint(void *aux, const char *pnp)
return (UNCONF);
}
static int
eisasubmatch(struct device *parent, struct cfdata *cf,
const locdesc_t * locs, void *aux)
{
if (cf->cf_loc[EISACF_SLOT] != EISACF_SLOT_DEFAULT &&
cf->cf_loc[EISACF_SLOT] != locs[EISACF_SLOT])
return (0);
return (config_match(parent, cf, aux));
}
static void
eisaattach(struct device *parent, struct device *self, void *aux)
{
@ -195,7 +182,7 @@ eisaattach(struct device *parent, struct device *self, void *aux)
/* Attach matching device. */
config_found_sm_loc(self, "eisa", locs, &ea,
eisaprint, eisasubmatch);
eisaprint, config_stdsubmatch);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: iop.c,v 1.49 2005/08/25 18:35:39 drochner Exp $ */
/* $NetBSD: iop.c,v 1.50 2005/08/25 22:33:18 drochner Exp $ */
/*-
* Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: iop.c,v 1.49 2005/08/25 18:35:39 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: iop.c,v 1.50 2005/08/25 22:33:18 drochner Exp $");
#include "opt_i2o.h"
#include "iop.h"
@ -228,8 +228,6 @@ static void iop_configure_devices(struct iop_softc *, int, int);
static void iop_devinfo(int, char *, size_t);
static int iop_print(void *, const char *);
static void iop_shutdown(void *);
static int iop_submatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
static void iop_adjqparam(struct iop_softc *, int);
static void iop_create_reconf_thread(void *);
@ -591,7 +589,8 @@ iop_config_interrupts(struct device *self)
ia.ia_class = I2O_CLASS_ANY;
ia.ia_tid = I2O_TID_IOP;
locs[IOPCF_TID] = I2O_TID_IOP;
config_found_sm_loc(self, "iop", locs, &ia, iop_print, iop_submatch);
config_found_sm_loc(self, "iop", locs, &ia, iop_print,
config_stdsubmatch);
/*
* Start device configuration.
@ -841,7 +840,7 @@ iop_configure_devices(struct iop_softc *sc, int mask, int maskval)
locs[IOPCF_TID] = ia.ia_tid;
dv = config_found_sm_loc(&sc->sc_dv, "iop", locs, &ia,
iop_print, iop_submatch);
iop_print, config_stdsubmatch);
if (dv != NULL) {
sc->sc_tidmap[i].it_flags |= IT_CONFIGURED;
strcpy(sc->sc_tidmap[i].it_dvname, dv->dv_xname);
@ -898,18 +897,6 @@ iop_print(void *aux, const char *pnp)
return (UNCONF);
}
static int
iop_submatch(struct device *parent, struct cfdata *cf,
const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[IOPCF_TID] != IOPCF_TID_DEFAULT &&
cf->cf_loc[IOPCF_TID] != locs[IOPCF_TID])
return (0);
return (config_match(parent, cf, aux));
}
/*
* Shut down all configured IOPs.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: aac.c,v 1.22 2005/08/25 18:35:39 drochner Exp $ */
/* $NetBSD: aac.c,v 1.23 2005/08/25 22:33:18 drochner Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: aac.c,v 1.22 2005/08/25 18:35:39 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: aac.c,v 1.23 2005/08/25 22:33:18 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -111,8 +111,6 @@ static int aac_sync_command(struct aac_softc *, u_int32_t, u_int32_t,
u_int32_t, u_int32_t, u_int32_t, u_int32_t *);
static int aac_sync_fib(struct aac_softc *, u_int32_t, u_int32_t, void *,
u_int16_t, void *, u_int16_t *);
static int aac_submatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
#ifdef AAC_DEBUG
static void aac_print_fib(struct aac_softc *, struct aac_fib *, char *);
@ -256,7 +254,7 @@ aac_attach(struct aac_softc *sc)
locs[AACCF_UNIT] = i;
config_found_sm_loc(&sc->sc_dv, "aac", locs, &aaca,
aac_print, aac_submatch);
aac_print, config_stdsubmatch);
}
/*
@ -304,21 +302,6 @@ aac_print(void *aux, const char *pnp)
return (UNCONF);
}
/*
* Match a sub-device.
*/
static int
aac_submatch(struct device *parent, struct cfdata *cf,
const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[AACCF_UNIT] != AACCF_UNIT_DEFAULT &&
cf->cf_loc[AACCF_UNIT] != locs[AACCF_UNIT])
return (0);
return (config_match(parent, cf, aux));
}
/*
* Look up a text description of a numeric error code and return a pointer to
* same.

View File

@ -1,4 +1,4 @@
/* $NetBSD: cac.c,v 1.31 2005/08/25 18:35:39 drochner Exp $ */
/* $NetBSD: cac.c,v 1.32 2005/08/25 22:33:18 drochner Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.31 2005/08/25 18:35:39 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.32 2005/08/25 22:33:18 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -71,8 +71,6 @@ static int cac_ccb_poll(struct cac_softc *, struct cac_ccb *, int);
static int cac_ccb_start(struct cac_softc *, struct cac_ccb *);
static int cac_print(void *, const char *);
static void cac_shutdown(void *);
static int cac_submatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
static struct cac_ccb *cac_l0_completed(struct cac_softc *);
static int cac_l0_fifo_full(struct cac_softc *);
@ -187,7 +185,7 @@ cac_init(struct cac_softc *sc, const char *intrstr, int startfw)
locs[CACCF_UNIT] = i;
config_found_sm_loc(&sc->sc_dv, "cac", locs, &caca,
cac_print, cac_submatch);
cac_print, config_stdsubmatch);
}
/* Set our `shutdownhook' before we start any device activity. */
@ -235,21 +233,6 @@ cac_print(void *aux, const char *pnp)
return (UNCONF);
}
/*
* Match a sub-device.
*/
static int
cac_submatch(struct device *parent, struct cfdata *cf,
const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[CACCF_UNIT] != CACCF_UNIT_DEFAULT &&
cf->cf_loc[CACCF_UNIT] != locs[CACCF_UNIT])
return (0);
return (config_match(parent, cf, aux));
}
/*
* Handle an interrupt from the controller: process finished CCBs and
* dequeue any waiting CCBs.

View File

@ -1,4 +1,4 @@
/* $NetBSD: i82365.c,v 1.91 2005/08/25 18:35:39 drochner Exp $ */
/* $NetBSD: i82365.c,v 1.92 2005/08/25 22:33:19 drochner Exp $ */
/*
* Copyright (c) 2004 Charles M. Hannum. All rights reserved.
@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: i82365.c,v 1.91 2005/08/25 18:35:39 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: i82365.c,v 1.92 2005/08/25 22:33:19 drochner Exp $");
#define PCICDEBUG
@ -89,8 +89,6 @@ int pcic_debug = 0;
void pcic_attach_socket(struct pcic_handle *);
void pcic_attach_socket_finish(struct pcic_handle *);
int pcic_submatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
int pcic_print (void *arg, const char *pnp);
int pcic_intr_socket(struct pcic_handle *);
void pcic_poll_intr(void *);
@ -417,7 +415,7 @@ pcic_attach_socket(h)
locs[PCMCIABUSCF_SOCKET] = h->socket;
h->pcmcia = config_found_sm_loc(&sc->dev, "pcmciabus", locs, &paa,
pcic_print, pcic_submatch);
pcic_print, config_stdsubmatch);
if (h->pcmcia == NULL) {
h->flags &= ~PCIC_FLAG_SOCKETP;
return;
@ -639,24 +637,6 @@ pcic_event_thread(arg)
kthread_exit(0);
}
int
pcic_submatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
const locdesc_t *locs;
void *aux;
{
if (cf->cf_loc[PCMCIABUSCF_CONTROLLER] != PCMCIABUSCF_CONTROLLER_DEFAULT &&
cf->cf_loc[PCMCIABUSCF_CONTROLLER] != locs[PCMCIABUSCF_CONTROLLER])
return 0;
if (cf->cf_loc[PCMCIABUSCF_SOCKET] != PCMCIABUSCF_SOCKET_DEFAULT &&
cf->cf_loc[PCMCIABUSCF_SOCKET] != locs[PCMCIABUSCF_SOCKET])
return 0;
return (config_match(parent, cf, aux));
}
int
pcic_print(arg, pnp)
void *arg;

View File

@ -1,4 +1,4 @@
/* $NetBSD: icp.c,v 1.15 2005/08/25 18:35:39 drochner Exp $ */
/* $NetBSD: icp.c,v 1.16 2005/08/25 22:33:19 drochner Exp $ */
/*-
* Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: icp.c,v 1.15 2005/08/25 18:35:39 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: icp.c,v 1.16 2005/08/25 22:33:19 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -117,8 +117,6 @@ int icp_async_event(struct icp_softc *, int);
void icp_ccb_submit(struct icp_softc *icp, struct icp_ccb *ic);
void icp_chain(struct icp_softc *);
int icp_print(void *, const char *);
int icp_submatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
void icp_watchdog(void *);
void icp_ucmd_intr(struct icp_ccb *);
void icp_recompute_openings(struct icp_softc *);
@ -388,7 +386,7 @@ icp_init(struct icp_softc *icp, const char *intrstr)
icp->icp_children[icpa.icpa_unit] =
config_found_sm_loc(&icp->icp_dv, "icp", locs,
&icpa, icp_print, icp_submatch);
&icpa, icp_print, config_stdsubmatch);
}
}
@ -406,7 +404,7 @@ icp_init(struct icp_softc *icp, const char *intrstr)
icp->icp_children[icpa.icpa_unit] =
config_found_sm_loc(&icp->icp_dv, "icp", locs,
&icpa, icp_print, icp_submatch);
&icpa, icp_print, config_stdsubmatch);
}
}
@ -530,7 +528,7 @@ icp_rescan(struct icp_softc *icp, int unit)
locs[ICPCF_UNIT] = unit;
icp->icp_children[unit] = config_found_sm_loc(&icp->icp_dv,
"icp", locs, &icpa, icp_print, icp_submatch);
"icp", locs, &icpa, icp_print, config_stdsubmatch);
}
icp_recompute_openings(icp);
@ -642,18 +640,6 @@ icp_print(void *aux, const char *pnp)
return (UNCONF);
}
int
icp_submatch(struct device *parent, struct cfdata *cf,
const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[ICPCF_UNIT] != ICPCF_UNIT_DEFAULT &&
cf->cf_loc[ICPCF_UNIT] != locs[ICPCF_UNIT])
return (0);
return (config_match(parent, cf, aux));
}
int
icp_async_event(struct icp_softc *icp, int service)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: mlx.c,v 1.35 2005/08/25 18:35:39 drochner Exp $ */
/* $NetBSD: mlx.c,v 1.36 2005/08/25 22:33:19 drochner Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mlx.c,v 1.35 2005/08/25 18:35:39 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: mlx.c,v 1.36 2005/08/25 22:33:19 drochner Exp $");
#include "ld.h"
@ -133,8 +133,6 @@ static void mlx_periodic_thread(void *);
static int mlx_print(void *, const char *);
static int mlx_rebuild(struct mlx_softc *, int, int);
static void mlx_shutdown(void *);
static int mlx_submatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
static int mlx_user_command(struct mlx_softc *, struct mlx_usercommand *);
static __inline__ time_t mlx_curtime(void);
@ -645,7 +643,7 @@ mlx_configure(struct mlx_softc *mlx, int waitok)
locs[MLXCF_UNIT] = i;
ms->ms_dv = config_found_sm_loc(&mlx->mlx_dv, "mlx", locs,
&mlxa, mlx_print, mlx_submatch);
&mlxa, mlx_print, config_stdsubmatch);
nunits += (ms->ms_dv != NULL);
}
@ -674,21 +672,6 @@ mlx_print(void *aux, const char *pnp)
return (UNCONF);
}
/*
* Match a sub-device.
*/
static int
mlx_submatch(struct device *parent, struct cfdata *cf,
const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[MLXCF_UNIT] != MLXCF_UNIT_DEFAULT &&
cf->cf_loc[MLXCF_UNIT] != locs[MLXCF_UNIT])
return (0);
return (config_match(parent, cf, aux));
}
/*
* Shut down all configured `mlx' devices.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: tcic2.c,v 1.21 2005/08/25 18:35:39 drochner Exp $ */
/* $NetBSD: tcic2.c,v 1.22 2005/08/25 22:33:19 drochner Exp $ */
/*
* Copyright (c) 1998, 1999 Christoph Badura. All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tcic2.c,v 1.21 2005/08/25 18:35:39 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: tcic2.c,v 1.22 2005/08/25 22:33:19 drochner Exp $");
#undef TCICDEBUG
@ -70,8 +70,6 @@ int tcic_debug = 1;
void tcic_attach_socket(struct tcic_handle *);
void tcic_init_socket(struct tcic_handle *);
int tcic_submatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
int tcic_print(void *arg, const char *pnp);
int tcic_intr_socket(struct tcic_handle *);
@ -433,7 +431,7 @@ tcic_attach_socket(h)
locs[PCMCIABUSCF_SOCKET] = h->sock;
h->pcmcia = config_found_sm_loc(&h->sc->dev, "pcmciabus", locs, &paa,
tcic_print, tcic_submatch);
tcic_print, config_stdsubmatch);
/* if there's actually a pcmcia device attached, initialize the slot */
@ -535,24 +533,6 @@ tcic_init_socket(h)
tcic_attach_card(h);
}
int
tcic_submatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
const locdesc_t *locs;
void *aux;
{
if (cf->cf_loc[PCMCIABUSCF_CONTROLLER] != PCMCIABUSCF_CONTROLLER_DEFAULT &&
cf->cf_loc[PCMCIABUSCF_CONTROLLER] != locs[PCMCIABUSCF_CONTROLLER])
return 0;
if (cf->cf_loc[PCMCIABUSCF_SOCKET] != PCMCIABUSCF_SOCKET_DEFAULT &&
cf->cf_loc[PCMCIABUSCF_SOCKET] != locs[PCMCIABUSCF_SOCKET])
return 0;
return (config_match(parent, cf, aux));
}
int
tcic_print(arg, pnp)
void *arg;

View File

@ -1,4 +1,4 @@
/* $NetBSD: upc.c,v 1.10 2005/08/25 18:35:39 drochner Exp $ */
/* $NetBSD: upc.c,v 1.11 2005/08/25 22:33:19 drochner Exp $ */
/*-
* Copyright (c) 2000, 2003 Ben Harris
* All rights reserved.
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: upc.c,v 1.10 2005/08/25 18:35:39 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: upc.c,v 1.11 2005/08/25 22:33:19 drochner Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -70,8 +70,6 @@ static void upc_found(struct upc_softc *, char const *, int, int,
static void upc_found2(struct upc_softc *, char const *, int, int, int, int,
struct upc_irqhandle *);
static int upc_print(void *, char const *);
static int upc_submatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
static int upc2_com3_addr(int);
static int upc2_com4_addr(int);
@ -222,7 +220,7 @@ upc_found(struct upc_softc *sc, char const *devtype, int offset, int size,
locs[UPCCF_OFFSET] = offset;
config_found_sm_loc(&sc->sc_dev, "upc", locs, &ua,
upc_print, upc_submatch);
upc_print, config_stdsubmatch);
}
static void
@ -243,7 +241,7 @@ upc_found2(struct upc_softc *sc, char const *devtype, int offset, int size,
locs[UPCCF_OFFSET] = offset;
config_found_sm_loc(&sc->sc_dev, "upc", locs, &ua,
upc_print, upc_submatch);
upc_print, config_stdsubmatch);
}
void
@ -301,19 +299,6 @@ upc_print(void *aux, char const *pnp)
return UNCONF;
}
static int
upc_submatch(struct device *parent, struct cfdata *cf,
const locdesc_t *locs, void *aux)
{
struct upc_attach_args *ua = aux;
if (strcmp(cf->cf_name, ua->ua_devtype) == 0 &&
(cf->cf_loc[UPCCF_OFFSET] == UPCCF_OFFSET_DEFAULT ||
cf->cf_loc[UPCCF_OFFSET] == locs[UPCCF_OFFSET]))
return config_match(parent, cf, aux);
return 0;
}
int
upc1_read_config(struct upc_softc *sc, int reg)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: mca.c,v 1.18 2005/08/25 18:35:39 drochner Exp $ */
/* $NetBSD: mca.c,v 1.19 2005/08/25 22:33:19 drochner Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mca.c,v 1.18 2005/08/25 18:35:39 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: mca.c,v 1.19 2005/08/25 22:33:19 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -62,8 +62,6 @@ void mca_attach(struct device *, struct device *, void *);
CFATTACH_DECL(mca, sizeof(struct device),
mca_match, mca_attach, NULL, NULL);
int mca_submatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
int mca_print(void *, const char *);
int
@ -117,20 +115,6 @@ mca_print(aux, pnp)
}
}
int
mca_submatch(parent, cf, locs, aux)
struct device *parent;
struct cfdata *cf;
const locdesc_t *locs;
void *aux;
{
if (cf->cf_loc[MCACF_SLOT] != MCACF_SLOT_DEFAULT &&
cf->cf_loc[MCACF_SLOT] != locs[MCACF_SLOT])
return 0;
return (config_match(parent, cf, aux));
}
void
mca_attach(parent, self, aux)
struct device *parent, *self;
@ -182,7 +166,7 @@ mca_attach(parent, self, aux)
if (ma.ma_pos[2] & MCA_POS2_ENABLE
|| mca_match_disabled(ma.ma_id))
config_found_sm_loc(self, "mca", locs, &ma,
mca_print, mca_submatch);
mca_print, config_stdsubmatch);
else {
mca_print(&ma, self->dv_xname);
printf(" disabled\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: mii.c,v 1.38 2005/08/25 18:35:39 drochner Exp $ */
/* $NetBSD: mii.c,v 1.39 2005/08/25 22:33:19 drochner Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.38 2005/08/25 18:35:39 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.39 2005/08/25 22:33:19 drochner Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -59,8 +59,6 @@ __KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.38 2005/08/25 18:35:39 drochner Exp $");
#include "locators.h"
static int mii_print(void *, const char *);
static int mii_submatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
/*
* Helper function used by network interface drivers, attaches PHYs
@ -146,7 +144,7 @@ mii_attach(struct device *parent, struct mii_data *mii, int capmask,
locs[MIICF_PHY] = ma.mii_phyno;
child = (struct mii_softc *)config_found_sm_loc(parent, "mii",
locs, &ma, mii_print, mii_submatch);
locs, &ma, mii_print, config_stdsubmatch);
if (child) {
/*
* Link it up in the parent's MII data.
@ -235,18 +233,6 @@ mii_print(void *aux, const char *pnp)
return (UNCONF);
}
static int
mii_submatch(struct device *parent, struct cfdata *cf,
const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[MIICF_PHY] != MIICF_PHY_DEFAULT &&
cf->cf_loc[MIICF_PHY] != locs[MIICF_PHY])
return (0);
return (config_match(parent, cf, aux));
}
/*
* Media changed; notify all PHYs.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci.c,v 1.94 2005/08/25 18:35:39 drochner Exp $ */
/* $NetBSD: pci.c,v 1.95 2005/08/25 22:33:19 drochner Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.94 2005/08/25 18:35:39 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.95 2005/08/25 22:33:19 drochner Exp $");
#include "opt_pci.h"
@ -59,8 +59,6 @@ int pci_config_dump = 0;
#endif
int pciprint(void *, const char *);
int pcisubmatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
#ifdef PCI_MACHDEP_ENUMERATE_BUS
#define pci_enumerate_bus PCI_MACHDEP_ENUMERATE_BUS
@ -243,20 +241,6 @@ pciprint(void *aux, const char *pnp)
return (UNCONF);
}
int
pcisubmatch(struct device *parent, struct cfdata *cf,
const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[PCICF_DEV] != PCICF_DEV_DEFAULT &&
cf->cf_loc[PCICF_DEV] != locs[PCICF_DEV])
return (0);
if (cf->cf_loc[PCICF_FUNCTION] != PCICF_FUNCTION_DEFAULT &&
cf->cf_loc[PCICF_FUNCTION] != locs[PCICF_FUNCTION])
return (0);
return (config_match(parent, cf, aux));
}
int
pci_probe_device(struct pci_softc *sc, pcitag_t tag,
int (*match)(struct pci_attach_args *), struct pci_attach_args *pap)
@ -353,7 +337,7 @@ pci_probe_device(struct pci_softc *sc, pcitag_t tag,
locs[PCICF_FUNCTION] = function;
subdev = config_found_sm_loc(&sc->sc_dev, "pci", locs, &pa,
pciprint, pcisubmatch);
pciprint, config_stdsubmatch);
sc->PCI_SC_DEVICESC(device, function) = subdev;
ret = (subdev != NULL);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: pckbport.c,v 1.5 2005/08/25 18:35:39 drochner Exp $ */
/* $NetBSD: pckbport.c,v 1.6 2005/08/25 22:33:19 drochner Exp $ */
/*
* Copyright (c) 2004 Ben Harris
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pckbport.c,v 1.5 2005/08/25 18:35:39 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: pckbport.c,v 1.6 2005/08/25 22:33:19 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -77,8 +77,6 @@ struct pckbport_slotdata {
#define CMD_IN_QUEUE(q) (TAILQ_FIRST(&(q)->cmdqueue) != NULL)
static void pckbport_init_slotdata(struct pckbport_slotdata *);
static int pckbport_submatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
static int pckbportprint(void *, const char *);
static struct pckbport_slotdata pckbport_cons_slotdata;
@ -118,17 +116,6 @@ pckbport_send_devcmd(struct pckbport_tag *t, pckbport_slot_t slot, u_char val)
return t->t_ops->t_send_devcmd(t->t_cookie, slot, val);
}
static int
pckbport_submatch(struct device *parent, struct cfdata *cf,
const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[PCKBPORTCF_SLOT] != PCKBPORTCF_SLOT_DEFAULT &&
cf->cf_loc[PCKBPORTCF_SLOT] != locs[PCKBPORTCF_SLOT])
return 0;
return config_match(parent, cf, aux);
}
pckbport_tag_t
pckbport_attach(void *cookie, struct pckbport_accessops const *ops)
{
@ -172,7 +159,7 @@ pckbport_attach_slot(struct device *dev, pckbport_tag_t t,
locs[PCKBPORTCF_SLOT] = slot;
found = config_found_sm_loc(dev, "pckbport", locs, &pa,
pckbportprint, pckbport_submatch);
pckbportprint, config_stdsubmatch);
if (found == NULL && alloced) {
free(t->t_slotdata[slot], M_DEVBUF);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pcmcia.c,v 1.75 2005/08/25 18:35:39 drochner Exp $ */
/* $NetBSD: pcmcia.c,v 1.76 2005/08/25 22:33:19 drochner Exp $ */
/*
* Copyright (c) 2004 Charles M. Hannum. All rights reserved.
@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pcmcia.c,v 1.75 2005/08/25 18:35:39 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: pcmcia.c,v 1.76 2005/08/25 22:33:19 drochner Exp $");
#include "opt_pcmciaverbose.h"
@ -79,8 +79,6 @@ int pcmcia_verbose = 0;
#endif
int pcmcia_match(struct device *, struct cfdata *, void *);
int pcmcia_submatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
void pcmcia_attach(struct device *, struct device *, void *);
int pcmcia_rescan(struct device *, const char *, const int *);
void pcmcia_childdetached(struct device *, struct device *);
@ -242,7 +240,8 @@ pcmcia_rescan(struct device *self, const char *ifattr, const int *locators)
paa.pf = pf;
pf->child = config_found_sm_loc(self, "pcmcia", locs, &paa,
pcmcia_print, pcmcia_submatch);
pcmcia_print,
config_stdsubmatch);
}
return (0);
@ -329,21 +328,6 @@ pcmcia_card_deactivate(dev)
}
}
int
pcmcia_submatch(parent, cf, locs, aux)
struct device *parent;
const locdesc_t *locs;
struct cfdata *cf;
void *aux;
{
if (cf->cf_loc[PCMCIACF_FUNCTION] != PCMCIACF_FUNCTION_DEFAULT &&
cf->cf_loc[PCMCIACF_FUNCTION] != locs[PCMCIACF_FUNCTION])
return (0);
return (config_match(parent, cf, aux));
}
int
pcmcia_print(arg, pnp)
void *arg;

View File

@ -1,4 +1,4 @@
/* $NetBSD: scsiconf.c,v 1.231 2005/08/25 18:35:40 drochner Exp $ */
/* $NetBSD: scsiconf.c,v 1.232 2005/08/25 22:33:19 drochner Exp $ */
/*-
* Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.231 2005/08/25 18:35:40 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.232 2005/08/25 22:33:19 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -101,9 +101,6 @@ static int scsibusdetach(struct device *, int flags);
static int scsibusrescan(struct device *, const char *, const int *);
static void scsidevdetached(struct device *, struct device *);
static int scsibussubmatch(struct device *, struct cfdata *,
const locdesc_t *, void *);
CFATTACH_DECL2(scsibus, sizeof(struct scsibus_softc),
scsibusmatch, scsibusattach, scsibusdetach, scsibusactivate,
scsibusrescan, scsidevdetached);
@ -242,20 +239,6 @@ scsibus_config(struct scsipi_channel *chan, void *arg)
config_pending_decr();
}
static int
scsibussubmatch(struct device *parent, struct cfdata *cf,
const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[SCSIBUSCF_TARGET] != SCSIBUSCF_TARGET_DEFAULT &&
cf->cf_loc[SCSIBUSCF_TARGET] != locs[SCSIBUSCF_TARGET])
return (0);
if (cf->cf_loc[SCSIBUSCF_LUN] != SCSIBUSCF_LUN_DEFAULT &&
cf->cf_loc[SCSIBUSCF_LUN] != locs[SCSIBUSCF_LUN])
return (0);
return (config_match(parent, cf, aux));
}
static int
scsibusactivate(struct device *self, enum devact act)
{
@ -956,7 +939,7 @@ scsi_probe_device(struct scsibus_softc *sc, int target, int lun)
locs[SCSIBUSCF_TARGET] = target;
locs[SCSIBUSCF_LUN] = lun;
if ((cf = config_search_loc(scsibussubmatch, &sc->sc_dev,
if ((cf = config_search_loc(config_stdsubmatch, &sc->sc_dev,
"scsibus", locs, &sa)) != NULL) {
scsipi_insert_periph(chan, periph);
/*