}
EXPORT_SYMBOL_GPL(mite_setup);
-void mite_unsetup(struct mite_struct *mite)
+void mite_detach(struct mite_struct *mite)
{
- /* unsigned long offset, start, length; */
-
if (!mite)
return;
- if (mite->mite_io_addr) {
+ if (mite->mite_io_addr)
iounmap(mite->mite_io_addr);
- mite->mite_io_addr = NULL;
- }
- if (mite->daq_io_addr) {
+ if (mite->daq_io_addr)
iounmap(mite->daq_io_addr);
- mite->daq_io_addr = NULL;
- }
- if (mite->mite_phys_addr)
- mite->mite_phys_addr = 0;
+
+ kfree(mite);
}
-EXPORT_SYMBOL_GPL(mite_unsetup);
+EXPORT_SYMBOL_GPL(mite_detach);
struct mite_dma_descriptor_ring *mite_alloc_ring(struct mite_struct *mite)
{
struct mite_struct *mite_alloc(struct pci_dev *pcidev);
-static inline void mite_free(struct mite_struct *mite)
-{
- kfree(mite);
-}
-
int mite_setup(struct mite_struct *mite);
int mite_setup2(struct mite_struct *mite, unsigned use_iodwbsr_1);
-void mite_unsetup(struct mite_struct *mite);
+void mite_detach(struct mite_struct *mite);
struct mite_dma_descriptor_ring *mite_alloc_ring(struct mite_struct *mite);
void mite_free_ring(struct mite_dma_descriptor_ring *ring);
struct mite_channel *mite_request_channel_in_range(struct mite_struct *mite,
}
if (dev->irq)
free_irq(dev->irq, dev);
- if (devpriv) {
- if (devpriv->mite) {
- mite_unsetup(devpriv->mite);
- mite_free(devpriv->mite);
- }
- }
+ if (devpriv)
+ mite_detach(devpriv->mite);
comedi_pci_disable(dev);
}
if (devpriv) {
if (devpriv->counter_dev)
ni_gpct_device_destroy(devpriv->counter_dev);
- if (devpriv->mite) {
- ni_660x_free_mite_rings(dev);
- mite_unsetup(devpriv->mite);
- mite_free(devpriv->mite);
- }
+ ni_660x_free_mite_rings(dev);
+ mite_detach(devpriv->mite);
}
comedi_pci_disable(dev);
}
if (s)
kfree(s->range_table_list);
}
- if (devpriv && devpriv->mite) {
- mite_unsetup(devpriv->mite);
- mite_free(devpriv->mite);
- }
+ if (devpriv)
+ mite_detach(devpriv->mite);
comedi_pci_disable(dev);
}
{
struct labpc_private *devpriv = dev->private;
- if (devpriv && devpriv->mite) {
- mite_unsetup(devpriv->mite);
- mite_free(devpriv->mite);
- }
+ if (devpriv)
+ mite_detach(devpriv->mite);
if (dev->irq)
free_irq(dev->irq, dev);
comedi_pci_disable(dev);
mite_free_ring(devpriv->di_mite_ring);
devpriv->di_mite_ring = NULL;
}
- if (devpriv->mite) {
- mite_unsetup(devpriv->mite);
- mite_free(devpriv->mite);
- }
+ mite_detach(devpriv->mite);
}
comedi_pci_disable(dev);
}
mite_free_ring(devpriv->cdo_mite_ring);
mite_free_ring(devpriv->gpct_mite_ring[0]);
mite_free_ring(devpriv->gpct_mite_ring[1]);
- if (devpriv->mite) {
- mite_unsetup(devpriv->mite);
- mite_free(devpriv->mite);
- }
+ mite_detach(devpriv->mite);
}
comedi_pci_disable(dev);
}