Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325198
b: refs/heads/master
c: 12b4a09
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 11, 2012
1 parent ca5b07e commit cc81885
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 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: aa1b2cb3c5930bb332d756bd566771dcc83f251b
refs/heads/master: 12b4a097b6fd6d7c7e18dbb40d2ed62cdc26cd3b
28 changes: 7 additions & 21 deletions trunk/drivers/staging/comedi/drivers/icp_multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ static int icp_multi_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct comedi_subdevice *s;
int ret, subdev, n_subdevices;
int ret;
unsigned int irq;
struct pcilst_struct *card = NULL;
resource_size_t io_addr[5], iobase;
Expand Down Expand Up @@ -753,14 +753,7 @@ static int icp_multi_attach(struct comedi_device *dev,

dev->board_name = this_board->name;

n_subdevices = 0;
n_subdevices++;
n_subdevices++;
n_subdevices++;
n_subdevices++;
n_subdevices++;

ret = comedi_alloc_subdevices(dev, n_subdevices);
ret = comedi_alloc_subdevices(dev, 5);
if (ret)
return ret;

Expand All @@ -782,9 +775,7 @@ static int icp_multi_attach(struct comedi_device *dev,

printk(KERN_WARNING ".\n");

subdev = 0;

s = &dev->subdevices[subdev];
s = &dev->subdevices[0];
dev->read_subdev = s;
s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_GROUND | SDF_DIFF;
Expand All @@ -793,9 +784,8 @@ static int icp_multi_attach(struct comedi_device *dev,
s->len_chanlist = 16;
s->range_table = &range_analog;
s->insn_read = icp_multi_insn_read_ai;
subdev++;

s = &dev->subdevices[subdev];
s = &dev->subdevices[1];
s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE | SDF_GROUND | SDF_COMMON;
s->n_chan = 4;
Expand All @@ -804,9 +794,8 @@ static int icp_multi_attach(struct comedi_device *dev,
s->range_table = &range_analog;
s->insn_write = icp_multi_insn_write_ao;
s->insn_read = icp_multi_insn_read_ao;
subdev++;

s = &dev->subdevices[subdev];
s = &dev->subdevices[2];
s->type = COMEDI_SUBD_DI;
s->subdev_flags = SDF_READABLE;
s->n_chan = 16;
Expand All @@ -815,9 +804,8 @@ static int icp_multi_attach(struct comedi_device *dev,
s->range_table = &range_digital;
s->io_bits = 0;
s->insn_bits = icp_multi_insn_bits_di;
subdev++;

s = &dev->subdevices[subdev];
s = &dev->subdevices[3];
s->type = COMEDI_SUBD_DO;
s->subdev_flags = SDF_WRITABLE | SDF_READABLE;
s->n_chan = 8;
Expand All @@ -827,9 +815,8 @@ static int icp_multi_attach(struct comedi_device *dev,
s->io_bits = 0xff;
s->state = 0;
s->insn_bits = icp_multi_insn_bits_do;
subdev++;

s = &dev->subdevices[subdev];
s = &dev->subdevices[4];
s->type = COMEDI_SUBD_COUNTER;
s->subdev_flags = SDF_WRITABLE | SDF_GROUND | SDF_COMMON;
s->n_chan = 4;
Expand All @@ -838,7 +825,6 @@ static int icp_multi_attach(struct comedi_device *dev,
s->state = 0;
s->insn_read = icp_multi_insn_read_ctr;
s->insn_write = icp_multi_insn_write_ctr;
subdev++;

devpriv->valid = 1;

Expand Down

0 comments on commit cc81885

Please sign in to comment.