diff options
author | imp <imp@FreeBSD.org> | 2000-08-22 04:25:57 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2000-08-22 04:25:57 +0000 |
commit | ceb2a14b74ef4de8020b11335cce39dca6eb3ae8 (patch) | |
tree | 969d2725240303b22645565a8ce3415c2c0a179b /sys/dev/pccard | |
parent | 13942925c5fd50ec5cf7a1e7dd5177bcb07c5b4d (diff) | |
download | FreeBSD-src-ceb2a14b74ef4de8020b11335cce39dca6eb3ae8.zip FreeBSD-src-ceb2a14b74ef4de8020b11335cce39dca6eb3ae8.tar.gz |
Save a pointer to the dev, if any, that each function attach.
Remove some bogus printfs.
Diffstat (limited to 'sys/dev/pccard')
-rw-r--r-- | sys/dev/pccard/pccard.c | 8 | ||||
-rw-r--r-- | sys/dev/pccard/pccardvar.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c index bd96857..4b2c4a3 100644 --- a/sys/dev/pccard/pccard.c +++ b/sys/dev/pccard/pccard.c @@ -133,11 +133,11 @@ pccard_attach_card(device_t dev) if (STAILQ_EMPTY(&pf->cfe_head)) continue; - printf ("pf %p sc %p\n", pf, sc); pf->sc = sc; pf->cfe = NULL; pf->ih_fct = NULL; pf->ih_arg = NULL; + pf->dev = NULL; } DEVPRINTF((dev, "chip_socket_disable\n")); @@ -165,6 +165,7 @@ pccard_attach_card(device_t dev) device_printf(dev, "pf %p pf->sc %p\n", pf, pf->sc); if (device_probe_and_attach(child) == 0) { attached++; + pf->dev = child; DEVPRINTF((sc->dev, "function %d CCR at %d " "offset %x: %x %x %x %x, %x %x %x %x, %x\n", @@ -194,7 +195,8 @@ pccard_detach_card(device_t dev, int flags) continue; pccard_function_disable(pf); - device_delete_child(device_get_parent(dev), dev); + if (pf->dev) + device_delete_child(dev, pf->dev); } return 0; } @@ -690,3 +692,5 @@ DRIVER_MODULE(pccard, pcic, pccard_driver, pccard_devclass, 0, 0); DRIVER_MODULE(pccard, pc98pcic, pccard_driver, pccard_devclass, 0, 0); DRIVER_MODULE(pccard, pccbb, pccard_driver, pccard_devclass, 0, 0); DRIVER_MODULE(pccard, tcic, pccard_driver, pccard_devclass, 0, 0); +MODULE_VERSION(pccard, 1); +MODULE_DEPEND(pccard, pcic, 1, 1, 1); diff --git a/sys/dev/pccard/pccardvar.h b/sys/dev/pccard/pccardvar.h index 290e5d6..a730459 100644 --- a/sys/dev/pccard/pccardvar.h +++ b/sys/dev/pccard/pccardvar.h @@ -121,6 +121,7 @@ struct pccard_function { struct pccard_softc *sc; struct pccard_config_entry *cfe; struct pccard_mem_handle pf_pcmh; + device_t dev; #define pf_ccrt pf_pcmh.memt #define pf_ccrh pf_pcmh.memh #define pf_ccr_realsize pf_pcmh.realsize |