Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364046
b: refs/heads/master
c: 7c0bad2
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Apr 11, 2013
1 parent c3ef27d commit 50a2224
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 26 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: 8234d51a280290a23e9c21d5f1a5988d984cbdc9
refs/heads/master: 7c0bad23e5d7011d1d350080fcbda4bec525521d
39 changes: 14 additions & 25 deletions trunk/drivers/staging/comedi/drivers/das16.c
Original file line number Diff line number Diff line change
Expand Up @@ -1079,13 +1079,11 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
struct comedi_subdevice *s;
int ret;
unsigned int irq;
unsigned long iobase;
unsigned int dma_chan;
int timer_mode;
unsigned long flags;
struct comedi_krange *user_ai_range, *user_ao_range;

iobase = it->options[0];
#if 0
irq = it->options[1];
timer_mode = it->options[8];
Expand All @@ -1097,8 +1095,6 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (timer_mode)
irq = 0;

printk(KERN_INFO "comedi%d: das16:", dev->minor);

/* check that clock setting is valid */
if (it->options[3]) {
if (it->options[3] != 0 &&
Expand All @@ -1116,33 +1112,26 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dev->private = devpriv;

if (board->size < 0x400) {
printk(" 0x%04lx-0x%04lx\n", iobase, iobase + board->size);
if (!request_region(iobase, board->size, dev->board_name)) {
printk(KERN_ERR " I/O port conflict\n");
return -EIO;
}
ret = comedi_request_region(dev, it->options[0], board->size);
if (ret)
return ret;
} else {
printk(KERN_INFO " 0x%04lx-0x%04lx 0x%04lx-0x%04lx\n",
iobase, iobase + 0x0f,
iobase + 0x400,
iobase + 0x400 + (board->size & 0x3ff));
if (!request_region(iobase, 0x10, dev->board_name)) {
printk(KERN_ERR " I/O port conflict: 0x%04lx-0x%04lx\n",
iobase, iobase + 0x0f);
return -EIO;
}
if (!request_region(iobase + 0x400, board->size & 0x3ff,
ret = comedi_request_region(dev, it->options[0], 0x10);
if (ret)
return ret;
/* Request an additional region for the 8255 */
if (!request_region(dev->iobase + 0x400, board->size & 0x3ff,
dev->board_name)) {
release_region(iobase, 0x10);
printk(KERN_ERR " I/O port conflict: 0x%04lx-0x%04lx\n",
iobase + 0x400,
iobase + 0x400 + (board->size & 0x3ff));
release_region(dev->iobase, 0x10);
dev_warn(dev->class_dev,
"%s: I/O port conflict (%#lx,%d)\n",
dev->board_name,
dev->iobase + 0x400, board->size & 0x3ff);
dev->iobase = 0;
return -EIO;
}
}

dev->iobase = iobase;

/* probe id bits to make sure they are consistent */
if (das16_probe(dev, it)) {
printk(KERN_ERR " id bits do not match selected board, aborting\n");
Expand Down

0 comments on commit 50a2224

Please sign in to comment.