clean up some useless code and variables in cardbus attachment

This commit is contained in:
drochner 2008-06-24 17:32:09 +00:00
parent 39ba286079
commit 52b8fec3cf
6 changed files with 17 additions and 32 deletions

View File

@ -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'.

View File

@ -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 <sys/cdefs.h>
__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);
}

View File

@ -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 */

View File

@ -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 <sys/cdefs.h>
__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;

View File

@ -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;

View File

@ -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 <sys/cdefs.h>
__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;
}