Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324972
b: refs/heads/master
c: b179748
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 8, 2012
1 parent 0616504 commit ca09910
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 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: 39780a1caf92342c4deb0d14d39703cf5c70cdac
refs/heads/master: b179748d21562decdf323f2d686920b836b3f272
21 changes: 10 additions & 11 deletions trunk/drivers/staging/comedi/drivers/me4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -1781,8 +1781,6 @@ static int me4000_attach_pci(struct comedi_device *dev,
if (!info->plx_regbase || !dev->iobase || !info->timer_regbase)
return -ENODEV;

dev->irq = pcidev->irq;

result = xilinx_download(dev);
if (result)
return result;
Expand Down Expand Up @@ -1811,23 +1809,22 @@ static int me4000_attach_pci(struct comedi_device *dev,
s->range_table = &me4000_ai_range;
s->insn_read = me4000_ai_insn_read;

if (dev->irq > 0) {
if (request_irq(dev->irq, me4000_ai_isr,
IRQF_SHARED, "ME-4000", dev)) {
printk
("comedi%d: me4000: me4000_attach(): "
"Unable to allocate irq\n", dev->minor);
if (pcidev->irq > 0) {
if (request_irq(pcidev->irq, me4000_ai_isr,
IRQF_SHARED, dev->board_name, dev)) {
dev_warn(dev->class_dev,
"request_irq failed\n");
} else {
dev->read_subdev = s;
s->subdev_flags |= SDF_CMD_READ;
s->cancel = me4000_ai_cancel;
s->do_cmdtest = me4000_ai_do_cmd_test;
s->do_cmd = me4000_ai_do_cmd;

dev->irq = pcidev->irq;
}
} else {
printk(KERN_WARNING
"comedi%d: me4000: me4000_attach(): "
"No interrupt available\n", dev->minor);
dev_warn(dev->class_dev, "No interrupt available\n");
}
} else {
s->type = COMEDI_SUBD_UNUSED;
Expand Down Expand Up @@ -1904,6 +1901,8 @@ static void me4000_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (dev->irq)
free_irq(dev->irq, dev);
if (pcidev) {
if (dev->iobase) {
reset_board(dev);
Expand Down

0 comments on commit ca09910

Please sign in to comment.