kernels/linux-2.4.0/drivers/isdn/avmb1/avm_cs.c
/*======================================================================

    This deletes a driver "instance".  The device is de-registered
    with Card Services.  If it has been released, all local data
    structures are freed.  Otherwise, the structures will be freed
    when the device is released.

======================================================================*/
This deletes a driver "instance".  The device is de-registered
with Card Services.  If it has been released, all local data
structures are freed.  Otherwise, the structures will be freed
when the device is released.
This deletes a driver " instance " . The device is de - registered with Card Services . If it has been released all local data structures are freed . Otherwise the structures will be freed when the device is released .
static void avmcs_detach(dev_link_t *link)
{
    dev_link_t **linkp;
    for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
	if (*linkp == link) break;
    if (*linkp == NULL)
	return;
    if (link->state & DEV_CONFIG) {
	link->state |= DEV_STALE_LINK;
	return;
    }
    if (link->handle)
	CardServices(DeregisterClient, link->handle);
    *linkp = link->next;
    if (link->priv) {
	kfree(link->priv);
    }
    kfree(link);
}
static void avmcs_detach ( dev_link_t * link ) { dev_link_t * * linkp ; for ( linkp = & dev_list ; * linkp ; linkp = & ( * linkp ) -> next ) if ( * linkp == link ) break ; if ( * linkp == NULL ) return ; if ( link -> state & DEV_CONFIG ) { link -> state |= DEV_STALE_LINK ; return ; } if ( link -> handle ) CardServices ( DeregisterClient , link -> handle ) ; * linkp = link -> next ; if ( link -> priv ) { kfree ( link -> priv ) ; } kfree ( link ) ; }
This deletes a driver "instance".
This deletes a driver " instance " .
/* Locate device structure */ /*
       If the device is currently configured and active, we won't
       actually delete it yet.  Instead, it is marked so that when
       the release() function is called, that will trigger a proper
       detach().
    */ /* Break the link with Card Services */ /* Unlink device structure, free pieces */