unsigned long offset, start, length;
u32 addr;
- if( pci_request_regions( mite->pcidev, "mite" ) ) {
- printk("failed to request mite io regions\n");
- return -EIO;
- };
if(pci_enable_device(mite->pcidev)){
printk("error enabling mite\n");
return -EIO;
}
pci_set_master(mite->pcidev);
+ if( pci_request_regions( mite->pcidev, "mite" ) ) {
+ printk("failed to request mite io regions\n");
+ return -EIO;
+ };
addr = pci_resource_start(mite->pcidev, 0);
mite->mite_phys_addr = addr;
iounmap(mite->daq_io_addr);
mite->daq_io_addr=NULL;
}
- pci_release_regions( mite->pcidev );
+ if( mite->used )
+ pci_release_regions( mite->pcidev );
mite->used = 0;
}