Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364039
b: refs/heads/master
c: 71827d4
h: refs/heads/master
i:
  364037: b798a1f
  364035: 07a0d19
  364031: c52d921
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Apr 11, 2013
1 parent 2e7fbc3 commit 314deac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 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: 9308902f301d628802e40b6c3fbefa11fc9dd9d9
refs/heads/master: 71827d43421824a11ac50d83b9e212061a84b025
26 changes: 3 additions & 23 deletions trunk/drivers/staging/comedi/drivers/amplc_dio200.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,44 +268,24 @@ static const struct dio200_board dio200_isa_boards[] = {
},
};

/*
* This function checks and requests an I/O region, reporting an error
* if there is a conflict.
*/
static int
dio200_request_region(struct comedi_device *dev,
unsigned long from, unsigned long extent)
{
if (!from || !request_region(from, extent, dev->board_name)) {
dev_err(dev->class_dev, "I/O port conflict (%#lx,%lu)!\n",
from, extent);
return -EIO;
}
return 0;
}

static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
const struct dio200_board *thisboard = comedi_board(dev);
struct dio200_private *devpriv;
unsigned long iobase;
unsigned int irq;
int ret;

iobase = it->options[0];
irq = it->options[1];
dev_info(dev->class_dev, "%s: attach %s 0x%lX,%u\n",
dev->driver->driver_name, dev->board_name, iobase, irq);

devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
if (!devpriv)
return -ENOMEM;
dev->private = devpriv;

ret = dio200_request_region(dev, iobase, thisboard->mainsize);
if (ret < 0)
ret = comedi_request_region(dev, it->options[0], thisboard->mainsize);
if (ret)
return ret;
devpriv->io.u.iobase = iobase;
devpriv->io.u.iobase = dev->iobase;
devpriv->io.regtype = io_regtype;
return amplc_dio200_common_attach(dev, irq, 0);
}
Expand Down

0 comments on commit 314deac

Please sign in to comment.