summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authordrochner <drochner@NetBSD.org>2008-06-24 17:32:09 +0000
committerdrochner <drochner@NetBSD.org>2008-06-24 17:32:09 +0000
commit52b8fec3cf88fa2ccc9417d191a2368a3b0fd6c2 (patch)
tree5e0605446065ed79d0813be7ec250c889f95dc75 /sys/dev
parent39ba286079e62516ae9a964daa86a2685fa737dd (diff)
clean up some useless code and variables in cardbus attachment
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cardbus/cardbus.c11
-rw-r--r--sys/dev/cardbus/cardbusvar.h3
-rw-r--r--sys/dev/cardbus/cardslot.c14
-rw-r--r--sys/dev/cardbus/cardslotvar.h7
-rw-r--r--sys/dev/pci/pccbb.c8
5 files changed, 14 insertions, 29 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c
index fb267cdc229..a674278ad7a 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 <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);
}
diff --git a/sys/dev/cardbus/cardbusvar.h b/sys/dev/cardbus/cardbusvar.h
index 34013bd8b41..291d100e073 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 b49cc8b5732..f42913f9c76 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 <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;
diff --git a/sys/dev/cardbus/cardslotvar.h b/sys/dev/cardbus/cardslotvar.h
index 6af70e2d6fa..da33e60126d 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 76f56d41061..5701576f32e 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 <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;
}