/* release all the cards assigned to a manager instance  */
static int pcxhr_free(struct pcxhr_mgr *mgr)
/* release all the cards assigned to a manager instance  */
static int pcxhr_free(struct pcxhr_mgr *mgr)
{
	unsigned int i;
	for (i = 0; i < mgr->num_cards; i++) {
		if (mgr->chip[i])
			snd_card_free(mgr->chip[i]->card);
	}
	if(mgr->dsp_loaded) {
		pcxhr_reset_board(mgr);
		snd_printdd("reset pcxhr !\n");
	}
	if (mgr->irq >= 0)
		free_irq(mgr->irq, mgr);
	pci_release_regions(mgr->pci);
	if (mgr->hostport.area) {
		snd_dma_free_pages(&mgr->hostport);
		mgr->hostport.area = NULL;
	}
	kfree(mgr->prmh);
	pci_disable_device(mgr->pci);
	kfree(mgr);
	return 0;
}