diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 1999-08-16 06:49:30 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 1999-08-16 06:49:30 +0000 |
commit | 5b81f2ad42616199e51add40fab4d5c90f1f2ea9 (patch) | |
tree | e97bf3ee4468975a312f89b80e6dfbef55f879a4 | |
parent | f5b146adce2379fed5370e188dee1a674c8ba143 (diff) |
Remove unnecessary code. Shorten dmesg output.
-rw-r--r-- | sys/dev/pcmcia/aic_pcmcia.c | 44 | ||||
-rw-r--r-- | sys/dev/pcmcia/if_ep_pcmcia.c | 35 |
2 files changed, 25 insertions, 54 deletions
diff --git a/sys/dev/pcmcia/aic_pcmcia.c b/sys/dev/pcmcia/aic_pcmcia.c index ca1f1ed8085..61b9a4e5f7c 100644 --- a/sys/dev/pcmcia/aic_pcmcia.c +++ b/sys/dev/pcmcia/aic_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic_pcmcia.c,v 1.5 1999/07/26 05:43:15 deraadt Exp $ */ +/* $OpenBSD: aic_pcmcia.c,v 1.6 1999/08/16 06:49:29 fgsch Exp $ */ /* $NetBSD: aic_pcmcia.c,v 1.6 1998/07/19 17:28:15 christos Exp $ */ /* @@ -71,44 +71,30 @@ struct aic_pcmcia_product { u_int32_t app_vendor; /* PCMCIA vendor ID */ u_int32_t app_product; /* PCMCIA product ID */ int app_expfunc; /* expected function number */ - const char *app_name; /* device name */ -} aic_pcmcia_products[] = { +} aic_pcmcia_prod[] = { { PCMCIA_VENDOR_ADAPTEC, PCMCIA_PRODUCT_ADAPTEC_APA1460_1, - 0, PCMCIA_STR_ADAPTEC_APA1460_1 }, + 0 }, + { PCMCIA_VENDOR_ADAPTEC, PCMCIA_PRODUCT_ADAPTEC_APA1460_2, - 0, PCMCIA_STR_ADAPTEC_APA1460_2 }, + 0 }, + { PCMCIA_VENDOR_NEWMEDIA, PCMCIA_PRODUCT_NEWMEDIA_BUSTOASTER, - 0, PCMCIA_STR_NEWMEDIA_BUSTOASTER }, - { 0, 0, - 0, NULL }, + 0 } }; -struct aic_pcmcia_product *aic_pcmcia_lookup __P((struct pcmcia_attach_args *)); - -struct aic_pcmcia_product * -aic_pcmcia_lookup(pa) - struct pcmcia_attach_args *pa; -{ - struct aic_pcmcia_product *app; - - for (app = aic_pcmcia_products; app->app_name != NULL; app++) { - if (pa->manufacturer == app->app_vendor && - pa->product == app->app_product && - pa->pf->number == app->app_expfunc) - return (app); - } - return (NULL); -} - int aic_pcmcia_match(parent, match, aux) struct device *parent; void *match, *aux; { struct pcmcia_attach_args *pa = aux; + int i; - if (aic_pcmcia_lookup(pa) != NULL) - return (1); + for (i = 0; i < sizeof(aic_pcmcia_prod)/sizeof(aic_pcmcia_prod[0]); i++) + if (pa->manufacturer == aic_pcmcia_prod[i].app_vendor && + pa->product == aic_pcmcia_prod[i].app_product && + pa->pf->number == aic_pcmcia_prod[i].app_expfunc) + return (1); return (0); } @@ -122,7 +108,6 @@ aic_pcmcia_attach(parent, self, aux) struct pcmcia_attach_args *pa = aux; struct pcmcia_config_entry *cfe; struct pcmcia_function *pf = pa->pf; - struct aic_pcmcia_product *app; psc->sc_pf = pf; @@ -174,9 +159,6 @@ aic_pcmcia_attach(parent, self, aux) return; } - app = aic_pcmcia_lookup(pa); - if (app) - printf(": %s", app->app_name); printf("\n"); aicattach(sc); diff --git a/sys/dev/pcmcia/if_ep_pcmcia.c b/sys/dev/pcmcia/if_ep_pcmcia.c index 78ab0e8d2ab..9097725bcb8 100644 --- a/sys/dev/pcmcia/if_ep_pcmcia.c +++ b/sys/dev/pcmcia/if_ep_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ep_pcmcia.c,v 1.17 1999/08/14 05:47:41 fgsch Exp $ */ +/* $OpenBSD: if_ep_pcmcia.c,v 1.18 1999/08/16 06:49:29 fgsch Exp $ */ /* $NetBSD: if_ep_pcmcia.c,v 1.16 1998/08/17 23:20:40 thorpej Exp $ */ /*- @@ -145,33 +145,23 @@ struct ep_pcmcia_product { u_short epp_chipset; /* 3Com chipset used */ int epp_flags; /* initial softc flags */ int epp_expfunc; /* expected function */ - const char *epp_name; /* device name */ -} ep_pcmcia_products[] = { +} ep_pcmcia_prod[] = { { PCMCIA_PRODUCT_3COM_3C562, EP_CHIPSET_3C509, - 0, 0, - PCMCIA_STR_3COM_3C562 }, + 0, 0 }, { PCMCIA_PRODUCT_3COM_3C589, EP_CHIPSET_3C509, - 0, 0, - PCMCIA_STR_3COM_3C589 }, + 0, 0 }, { PCMCIA_PRODUCT_3COM_3CXEM556, EP_CHIPSET_3C509, - 0, 0, - PCMCIA_STR_3COM_3CXEM556 }, + 0, 0 }, { PCMCIA_PRODUCT_3COM_3CXEM556B,EP_CHIPSET_3C509, - 0, 0, - PCMCIA_STR_3COM_3CXEM556B }, + 0, 0 }, #ifdef notyet { PCMCIA_PRODUCT_3COM_3C574, EP_CHIPSET_BOOMERANG, - EP_FLAGS_MII, 0, - PCMCIA_STR_3COM_3C574 }, + EP_FLAGS_MII, 0} #endif - - { 0, 0, - 0, 0, - NULL }, }; struct ep_pcmcia_product *ep_pcmcia_lookup __P((struct pcmcia_attach_args *)); @@ -180,12 +170,12 @@ struct ep_pcmcia_product * ep_pcmcia_lookup(pa) struct pcmcia_attach_args *pa; { - struct ep_pcmcia_product *epp; + int i; - for (epp = ep_pcmcia_products; epp->epp_name != NULL; epp++) - if (pa->product == epp->epp_product && - pa->pf->number == epp->epp_expfunc) - return (epp); + for (i = 0; i < sizeof(ep_pcmcia_prod)/sizeof(ep_pcmcia_prod[0]); i++) + if (pa->product == ep_pcmcia_prod[i].epp_product && + pa->pf->number == ep_pcmcia_prod[i].epp_expfunc) + return &ep_pcmcia_prod[i]; return (NULL); } @@ -375,7 +365,6 @@ ep_pcmcia_attach(parent, self, aux) if (sc->sc_ih == NULL) printf(", couldn't establish interrupt"); - printf(": <%s>", epp->epp_name); epconfig(sc, epp->epp_chipset, enaddr); #ifdef notyet |