prism2_free_local_data((struct net_device *) link->priv);
struct net_device *dev; struct hostap_interface *iface; dev = link->priv; iface = netdev_priv(dev); kfree(iface->local->hw_priv); iface->local->hw_priv = NULL; prism2_free_local_data(dev);
static void prism2_detach(dev_link_t *link){	dev_link_t **linkp;	PDEBUG(DEBUG_FLOW, "prism2_detach\n");	for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)		if (*linkp == link)			break;	if (*linkp == NULL) {		printk(KERN_WARNING "%s: Attempt to detach non-existing "		       "PCMCIA client\n", dev_info);		return;	}	if (link->state & DEV_CONFIG) {		prism2_release((u_long)link);	}	if (link->handle) {		int res = pcmcia_deregister_client(link->handle);		if (res) {			printk("CardService(DeregisterClient) => %d\n", res);			cs_error(link->handle, DeregisterClient, res);		}	}	*linkp = link->next;	/* release net devices */	if (link->priv) {		prism2_free_local_data((struct net_device *) link->priv);	}	kfree(link);}