Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/pccard/pccard.c
Show First 20 Lines • Show All 336 Lines • ▼ Show 20 Lines | pccard_detach_card(device_t dev) | ||||
/* | /* | ||||
* We are running on either the PCCARD socket's event thread | * We are running on either the PCCARD socket's event thread | ||||
* or in user context detaching a device by user request. | * or in user context detaching a device by user request. | ||||
*/ | */ | ||||
STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) { | STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) { | ||||
if (pf->dev == NULL) | if (pf->dev == NULL) | ||||
continue; | continue; | ||||
state = device_get_state(pf->dev); | state = device_get_state(pf->dev); | ||||
if (state == DS_ATTACHED || state == DS_BUSY) | if (state == DS_ATTACHED) | ||||
device_detach(pf->dev); | device_detach(pf->dev); | ||||
if (pf->cfe != NULL) | if (pf->cfe != NULL) | ||||
pccard_function_disable(pf); | pccard_function_disable(pf); | ||||
pccard_function_free(pf); | pccard_function_free(pf); | ||||
devi = PCCARD_IVAR(pf->dev); | devi = PCCARD_IVAR(pf->dev); | ||||
device_delete_child(dev, pf->dev); | device_delete_child(dev, pf->dev); | ||||
free(devi, M_DEVBUF); | free(devi, M_DEVBUF); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,127 Lines • Show Last 20 Lines |