Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318075
b: refs/heads/master
c: b6d446b
h: refs/heads/master
i:
  318073: ab6978f
  318071: 9bb649f
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 19, 2012
1 parent 7863d51 commit 94e1246
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ed7fd225efef11fb8c85ec650288702af69bbe83
refs/heads/master: b6d446b5de6139d2a5764c7568012ffa14e2aa6e
28 changes: 12 additions & 16 deletions trunk/drivers/staging/comedi/drivers/amplc_pc236.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ static const struct pc236_board pc236_boards[] = {
feel free to suggest moving the variable to the struct comedi_device struct.
*/
struct pc236_private {
/* PCI device */
struct pci_dev *pci_dev;
unsigned long lcr_iobase; /* PLX PCI9052 config registers in PCIBAR1 */
int enable_irq;
};
Expand Down Expand Up @@ -412,6 +410,7 @@ static irqreturn_t pc236_interrupt(int irq, void *d)
static void pc236_report_attach(struct comedi_device *dev, unsigned int irq)
{
const struct pc236_board *thisboard = comedi_board(dev);
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
char tmpbuf[60];
int tmplen;

Expand All @@ -421,10 +420,8 @@ static void pc236_report_attach(struct comedi_device *dev, unsigned int irq)
"(base %#lx) ", dev->iobase);
else if (IS_ENABLED(CONFIG_COMEDI_AMPLC_PC236_PCI) &&
thisboard->bustype == pci_bustype) {
struct pc236_private *devpriv = dev->private;
struct pci_dev *pci_dev = devpriv->pci_dev;
tmplen = scnprintf(tmpbuf, sizeof(tmpbuf),
"(pci %s) ", pci_name(pci_dev));
"(pci %s) ", pci_name(pcidev));
} else
tmplen = 0;
if (irq)
Expand Down Expand Up @@ -489,7 +486,8 @@ static int pc236_pci_common_attach(struct comedi_device *dev,
unsigned long iobase;
int ret;

devpriv->pci_dev = pci_dev;
comedi_set_hw_dev(dev, &pci_dev->dev);

ret = comedi_pci_enable(pci_dev, PC236_DRIVER_NAME);
if (ret < 0) {
dev_err(dev->class_dev,
Expand Down Expand Up @@ -573,23 +571,21 @@ static int __devinit pc236_attach_pci(struct comedi_device *dev,
static void pc236_detach(struct comedi_device *dev)
{
struct pc236_private *devpriv = dev->private;
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (devpriv)
pc236_intr_disable(dev);
if (dev->irq)
free_irq(dev->irq, dev);
if (dev->subdevices)
subdev_8255_cleanup(dev, dev->subdevices + 0);
if (devpriv) {
if (IS_ENABLED(CONFIG_COMEDI_AMPLC_PC236_PCI) &&
devpriv->pci_dev) {
if (dev->iobase)
comedi_pci_disable(devpriv->pci_dev);
pci_dev_put(devpriv->pci_dev);
} else if (IS_ENABLED(CONFIG_COMEDI_AMPLC_PC236_ISA)) {
if (dev->iobase)
release_region(dev->iobase, PC236_IO_SIZE);
}
if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
pci_dev_put(pcidev);
} else {
if (dev->iobase)
release_region(dev->iobase, PC236_IO_SIZE);
}
}

Expand Down

0 comments on commit 94e1246

Please sign in to comment.