staging: comedi: jr3_pci: remove devpriv->pci_enabled
The `pci_enabled` member of `struct jr3_pci_dev_private` is used to indicate whether the call to `comedi_pci_enable()` was successful. The 'detach' routine `jr3_pci_detach()` uses this to decide whether to call `comedi_pci_disable()`. The `iobase` member of `struct comedi_device` is not used by this driver so it can be used for the same purpose. Remove the `pci_enabled` member and use the spare `dev->iobase` instead. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
19d6ce5446
commit
ed610aa04c
@@ -59,7 +59,6 @@ Devices: [JR3] PCI force sensor board (jr3_pci)
|
|||||||
#define PCI_DEVICE_ID_JR3_4_CHANNEL 0x3114
|
#define PCI_DEVICE_ID_JR3_4_CHANNEL 0x3114
|
||||||
|
|
||||||
struct jr3_pci_dev_private {
|
struct jr3_pci_dev_private {
|
||||||
int pci_enabled;
|
|
||||||
struct jr3_t __iomem *iobase;
|
struct jr3_t __iomem *iobase;
|
||||||
int n_channels;
|
int n_channels;
|
||||||
struct timer_list timer;
|
struct timer_list timer;
|
||||||
@@ -787,7 +786,7 @@ static int __devinit jr3_pci_auto_attach(struct comedi_device *dev,
|
|||||||
if (result < 0)
|
if (result < 0)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
devpriv->pci_enabled = 1;
|
dev->iobase = 1; /* the "detach" needs this */
|
||||||
devpriv->iobase = ioremap(pci_resource_start(pcidev, 0),
|
devpriv->iobase = ioremap(pci_resource_start(pcidev, 0),
|
||||||
offsetof(struct jr3_t, channel[devpriv->n_channels]));
|
offsetof(struct jr3_t, channel[devpriv->n_channels]));
|
||||||
if (!devpriv->iobase)
|
if (!devpriv->iobase)
|
||||||
@@ -906,7 +905,7 @@ static void jr3_pci_detach(struct comedi_device *dev)
|
|||||||
}
|
}
|
||||||
if (devpriv->iobase)
|
if (devpriv->iobase)
|
||||||
iounmap(devpriv->iobase);
|
iounmap(devpriv->iobase);
|
||||||
if (devpriv->pci_enabled)
|
if (dev->iobase)
|
||||||
comedi_pci_disable(pcidev);
|
comedi_pci_disable(pcidev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user