use config_found_sm(), rather than config_search+config_attach()+glue, to

attach subdevices.
This commit is contained in:
cgd 1996-02-27 21:48:52 +00:00
parent c6a9e56518
commit a21351b381
2 changed files with 15 additions and 30 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: eisa.c,v 1.1 1996/02/27 00:21:00 cgd Exp $ */
/* $NetBSD: eisa.c,v 1.2 1996/02/27 21:51:17 cgd Exp $ */
/*
* Copyright (c) 1995, 1996 Christopher G. Demetriou
@ -80,12 +80,17 @@ eisamatch(parent, match, aux)
}
int
eisaprint(aux, eisa)
eisaprint(aux, pnp)
void *aux;
char *eisa;
char *pnp;
{
register struct eisa_attach_args *ea = aux;
char devinfo[256];
if (pnp) {
eisa_devinfo(ea->ea_idstring, devinfo);
printf("%s at %s", devinfo, pnp);
}
printf(" slot %d", ea->ea_slot);
return (UNCONF);
}
@ -169,16 +174,8 @@ eisaattach(parent, self, aux)
ea.ea_idstring[6] = EISA_PRODID_3(ea.ea_pid);
ea.ea_idstring[7] = '\0'; /* sanity */
/* Go hunt for devices that match. */
if ((cf = config_search(eisasubmatch, self, &ea)) != NULL)
config_attach(self, cf, &ea, eisaprint);
else {
char devinfo[256];
eisa_devinfo(ea.ea_idstring, devinfo);
printf("%s slot %d: %s not configured\n",
self->dv_xname, slot, devinfo);
}
/* Attach matching device. */
config_found_sm(self, &ea, eisaprint, eisasubmatch);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: tc.c,v 1.6 1996/02/27 07:07:26 cgd Exp $ */
/* $NetBSD: tc.c,v 1.7 1996/02/27 21:48:52 cgd Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@ -135,15 +135,9 @@ tcattach(parent, self, aux)
sc->sc_slots[builtin->tcb_slot].tcs_used = 1;
/*
* Find and attach the device.
* XXX a close relative of config_found()
* Attach the device.
*/
if ((match = config_search(tcsubmatch, self, &ta)) != NULL)
config_attach(self, match, &ta, tcprint);
else {
tcprint(&ta, self->dv_xname);
printf(" not configured\n");
}
config_found_sm(self, &ta, tcprint, tcsubmatch);
}
/*
@ -179,15 +173,9 @@ tcattach(parent, self, aux)
slot->tcs_used = 1;
/*
* Find and attach the device.
* XXX a close relative of config_found()
* Attach the device.
*/
if ((match = config_search(tcsubmatch, self, &ta)) != NULL)
config_attach(self, match, &ta, tcprint);
else {
tcprint(&ta, self->dv_xname);
printf(" not configured\n");
}
config_found_sm(self, &ta, tcprint, tcsubmatch);
}
}