Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324897
b: refs/heads/master
c: 3f507ce
h: refs/heads/master
i:
  324895: cae4839
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 6, 2012
1 parent 5f7b06e commit 11f57c6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 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: 66c5beee8f8de1a952192c8afe4d7708edbaa328
refs/heads/master: 3f507ce1ac0f7a6f5f205162d5c1db1524dfb162
19 changes: 11 additions & 8 deletions trunk/drivers/staging/comedi/drivers/ni_atmio16d.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ static void reset_atmio16d(struct comedi_device *dev)
static irqreturn_t atmio16d_interrupt(int irq, void *d)
{
struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->subdevices + 0;
struct comedi_subdevice *s = &dev->subdevices[0];

comedi_buf_put(s->async, inw(dev->iobase + AD_FIFO_REG));

Expand Down Expand Up @@ -724,7 +724,7 @@ static int atmio16d_attach(struct comedi_device *dev,
devpriv->dac1_coding = it->options[12];

/* setup sub-devices */
s = dev->subdevices + 0;
s = &dev->subdevices[0];
dev->read_subdev = s;
/* ai subdevice */
s->type = COMEDI_SUBD_AI;
Expand All @@ -749,7 +749,7 @@ static int atmio16d_attach(struct comedi_device *dev,
}

/* ao subdevice */
s++;
s = &dev->subdevices[1];
s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE;
s->n_chan = 2;
Expand All @@ -775,7 +775,7 @@ static int atmio16d_attach(struct comedi_device *dev,
}

/* Digital I/O */
s++;
s = &dev->subdevices[2];
s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_WRITABLE | SDF_READABLE;
s->n_chan = 8;
Expand All @@ -785,15 +785,15 @@ static int atmio16d_attach(struct comedi_device *dev,
s->range_table = &range_digital;

/* 8255 subdevice */
s++;
s = &dev->subdevices[3];
if (board->has_8255)
subdev_8255_init(dev, s, NULL, dev->iobase);
else
s->type = COMEDI_SUBD_UNUSED;

/* don't yet know how to deal with counter/timers */
#if 0
s++;
s = &dev->subdevices[4];
/* do */
s->type = COMEDI_SUBD_TIMER;
s->n_chan = 0;
Expand All @@ -807,9 +807,12 @@ static int atmio16d_attach(struct comedi_device *dev,
static void atmio16d_detach(struct comedi_device *dev)
{
const struct atmio16_board_t *board = comedi_board(dev);
struct comedi_subdevice *s;

if (dev->subdevices && board->has_8255)
subdev_8255_cleanup(dev, dev->subdevices + 3);
if (dev->subdevices && board->has_8255) {
s = &dev->subdevices[3];
subdev_8255_cleanup(dev, s);
}
if (dev->irq)
free_irq(dev->irq, dev);
reset_atmio16d(dev);
Expand Down

0 comments on commit 11f57c6

Please sign in to comment.