From 52b8fec3cf88fa2ccc9417d191a2368a3b0fd6c2 Mon Sep 17 00:00:00 2001 From: drochner Date: Tue, 24 Jun 2008 17:32:09 +0000 Subject: [PATCH] clean up some useless code and variables in cardbus attachment --- sys/conf/files | 6 +++--- sys/dev/cardbus/cardbus.c | 11 ++--------- sys/dev/cardbus/cardbusvar.h | 3 +-- sys/dev/cardbus/cardslot.c | 14 ++++++-------- sys/dev/cardbus/cardslotvar.h | 7 +------ sys/dev/pci/pccbb.c | 8 ++++---- 6 files changed, 17 insertions(+), 32 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 5fc778b3aebb..6e26c5d1818b 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1,4 +1,4 @@ -# $NetBSD: files,v 1.908 2008/06/10 14:03:57 cube Exp $ +# $NetBSD: files,v 1.909 2008/06/24 17:32:09 drochner Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 @@ -1067,8 +1067,8 @@ define fwbus { } # IEEE 1394 attachment define vmebus { } # VME bus attachment define acpibus { } # ACPI "bus" attachment define pcmciabus { [controller = -1], [socket = -1]} # PCMCIA bus attachment -define cbbus {[slot = -1]} # CardBus attachment -define pcmciaslot {[slot = -1]} # PCMCIA slot itself +define cbbus { } # CardBus attachment +define pcmciaslot { } # PCMCIA slot itself # We need the USB bus controllers here so different busses can # use them in an 'attach-with'. diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index fb267cdc2290..a674278ad7a6 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: cardbus.c,v 1.92 2008/06/11 07:01:54 dyoung Exp $ */ +/* $NetBSD: cardbus.c,v 1.93 2008/06/24 17:32:09 drochner Exp $ */ /* * Copyright (c) 1997, 1998, 1999 and 2000 @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cardbus.c,v 1.92 2008/06/11 07:01:54 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cardbus.c,v 1.93 2008/06/24 17:32:09 drochner Exp $"); #include "opt_cardbus.h" @@ -105,13 +105,6 @@ struct cfdriver cardbus_cd = { STATIC int cardbusmatch(device_t parent, struct cfdata *cf, void *aux) { - struct cbslot_attach_args *cba = aux; - - if (strcmp(cba->cba_busname, cf->cf_name)) { - DPRINTF(("cardbusmatch: busname differs %s <=> %s\n", - cba->cba_busname, cf->cf_name)); - return (0); - } return (1); } diff --git a/sys/dev/cardbus/cardbusvar.h b/sys/dev/cardbus/cardbusvar.h index 34013bd8b418..291d100e0732 100644 --- a/sys/dev/cardbus/cardbusvar.h +++ b/sys/dev/cardbus/cardbusvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: cardbusvar.h,v 1.39 2008/06/11 06:28:18 dyoung Exp $ */ +/* $NetBSD: cardbusvar.h,v 1.40 2008/06/24 17:32:09 drochner Exp $ */ /* * Copyright (c) 1998, 1999 and 2000 @@ -132,7 +132,6 @@ typedef struct cardbus_functions { * struct cbslot_attach_args is the attach argument for Cardbus cardslot. */ struct cbslot_attach_args { - const char *cba_busname; bus_space_tag_t cba_iot; /* cardbus i/o space tag */ bus_space_tag_t cba_memt; /* cardbus mem space tag */ bus_dma_tag_t cba_dmat; /* DMA tag */ diff --git a/sys/dev/cardbus/cardslot.c b/sys/dev/cardbus/cardslot.c index b49cc8b57322..f42913f9c768 100644 --- a/sys/dev/cardbus/cardslot.c +++ b/sys/dev/cardbus/cardslot.c @@ -1,4 +1,4 @@ -/* $NetBSD: cardslot.c,v 1.40 2008/04/06 07:54:17 cegger Exp $ */ +/* $NetBSD: cardslot.c,v 1.41 2008/06/24 17:32:09 drochner Exp $ */ /* * Copyright (c) 1999 and 2000 @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cardslot.c,v 1.40 2008/04/06 07:54:17 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cardslot.c,v 1.41 2008/06/24 17:32:09 drochner Exp $"); #include "opt_cardslot.h" @@ -108,15 +108,13 @@ cardslotattach(struct device *parent, struct device *self, struct cardbus_softc *csc = NULL; struct pcmcia_softc *psc = NULL; - sc->sc_slot = device_unit(&sc->sc_dev); sc->sc_cb_softc = NULL; sc->sc_16_softc = NULL; SIMPLEQ_INIT(&sc->sc_events); sc->sc_th_enable = 0; aprint_naive("\n"); - aprint_normal(" slot %d flags %x\n", sc->sc_slot, - device_cfdata(&sc->sc_dev)->cf_flags); + aprint_normal("\n"); DPRINTF(("%s attaching CardBus bus...\n", device_xname(&sc->sc_dev))); if (cba != NULL) { @@ -148,9 +146,9 @@ cardslotattach(struct device *parent, struct device *self, if (csc != NULL || psc != NULL) { config_pending_incr(); if (kthread_create(PRI_NONE, 0, NULL, cardslot_event_thread, - sc, &sc->sc_event_thread, "%s", device_xname(&sc->sc_dev))) { - aprint_error_dev(&sc->sc_dev, "unable to create thread for slot %d\n", - sc->sc_slot); + sc, &sc->sc_event_thread, "%s", device_xname(self))) { + aprint_error_dev(&sc->sc_dev, + "unable to create thread\n"); panic("cardslotattach"); } sc->sc_th_enable = 1; diff --git a/sys/dev/cardbus/cardslotvar.h b/sys/dev/cardbus/cardslotvar.h index 6af70e2d6fa5..da33e60126dd 100644 --- a/sys/dev/cardbus/cardslotvar.h +++ b/sys/dev/cardbus/cardslotvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: cardslotvar.h,v 1.11 2007/07/09 21:00:31 ad Exp $ */ +/* $NetBSD: cardslotvar.h,v 1.12 2008/06/24 17:32:09 drochner Exp $ */ /* * Copyright (c) 1999 @@ -45,10 +45,6 @@ struct cardslot_event; * PCMCIA (including CardBus and 16-bit card) slot. */ struct cardslot_attach_args { - char *caa_busname; - - int caa_slot; - /* for cardbus... */ struct cbslot_attach_args *caa_cb_attach; @@ -70,7 +66,6 @@ struct cardslot_attach_args { struct cardslot_softc { struct device sc_dev; - int sc_slot; /* slot number */ int sc_status; /* the status of slot */ struct cardbus_softc *sc_cb_softc; diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c index 76f56d410613..5701576f32ef 100644 --- a/sys/dev/pci/pccbb.c +++ b/sys/dev/pci/pccbb.c @@ -1,4 +1,4 @@ -/* $NetBSD: pccbb.c,v 1.169 2008/05/27 21:32:47 dyoung Exp $ */ +/* $NetBSD: pccbb.c,v 1.170 2008/06/24 17:32:09 drochner Exp $ */ /* * Copyright (c) 1998, 1999 and 2000 @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.169 2008/05/27 21:32:47 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.170 2008/06/24 17:32:09 drochner Exp $"); /* #define CBB_DEBUG @@ -682,7 +682,6 @@ pccbb_pci_callback(device_t self) pcireg_t bhlc = pci_conf_read(pc, sc->sc_tag, PCI_BHLC_REG); /* initialize cbslot_attach */ - cba.cba_busname = "cardbus"; cba.cba_iot = sc->sc_iot; cba.cba_memt = sc->sc_memt; cba.cba_dmat = sc->sc_dmat; @@ -722,7 +721,8 @@ pccbb_pci_callback(device_t self) pccbb_intrinit(sc); - if (NULL != (csc = (void *)config_found(self, &caa, cbbprint))) { + if (NULL != (csc = (void *)config_found_ia(self, "pcmciaslot", &caa, + cbbprint))) { DPRINTF(("%s: found cardslot\n", __func__)); sc->sc_csc = csc; }