Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354124
b: refs/heads/master
c: 20f2e2e
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jan 22, 2013
1 parent f2affa5 commit fb62d5d
Show file tree
Hide file tree
Showing 2 changed files with 9 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: 5872471364f0a49f95a8efbec80c622a24c7df6b
refs/heads/master: 20f2e2e1ceee6575794e9957912399d7ead8458f
33 changes: 8 additions & 25 deletions trunk/drivers/staging/comedi/drivers/addi_apci_2200.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static int apci2200_auto_attach(struct comedi_device *dev,
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
struct comedi_subdevice *s;
int ret, n_subdevices;
int ret;

dev->board_name = dev->driver->driver_name;

Expand All @@ -94,51 +94,34 @@ static int apci2200_auto_attach(struct comedi_device *dev,

dev->iobase = pci_resource_start(pcidev, 1);

n_subdevices = 7;
ret = comedi_alloc_subdevices(dev, n_subdevices);
ret = comedi_alloc_subdevices(dev, 3);
if (ret)
return ret;

/* Allocate and Initialise AI Subdevice Structures */
/* Initialize the digital input subdevice */
s = &dev->subdevices[0];
s->type = COMEDI_SUBD_UNUSED;

/* Allocate and Initialise AO Subdevice Structures */
s = &dev->subdevices[1];
s->type = COMEDI_SUBD_UNUSED;

/* Allocate and Initialise DI Subdevice Structures */
s = &dev->subdevices[2];
s->type = COMEDI_SUBD_DI;
s->subdev_flags = SDF_READABLE;
s->n_chan = 8;
s->maxdata = 1;
s->range_table = &range_digital;
s->insn_bits = apci2200_di_insn_bits;

/* Allocate and Initialise DO Subdevice Structures */
s = &dev->subdevices[3];
/* Initialize the digital output subdevice */
s = &dev->subdevices[1];
s->type = COMEDI_SUBD_DO;
s->subdev_flags = SDF_WRITEABLE;
s->n_chan = 16;
s->maxdata = 1;
s->range_table = &range_digital;
s->insn_bits = apci2200_do_insn_bits;

/* Allocate and Initialise Timer Subdevice Structures */
s = &dev->subdevices[4];
/* Initialize the watchdog subdevice */
s = &dev->subdevices[2];
ret = addi_watchdog_init(s, dev->iobase + APCI2200_WDOG_REG);
if (ret)
return ret;

/* Allocate and Initialise TTL */
s = &dev->subdevices[5];
s->type = COMEDI_SUBD_UNUSED;

/* EEPROM */
s = &dev->subdevices[6];
s->type = COMEDI_SUBD_UNUSED;

apci2200_reset(dev);
return 0;
}
Expand All @@ -150,7 +133,7 @@ static void apci2200_detach(struct comedi_device *dev)
if (dev->iobase)
apci2200_reset(dev);
if (dev->subdevices)
addi_watchdog_cleanup(&dev->subdevices[4]);
addi_watchdog_cleanup(&dev->subdevices[2]);
if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
Expand Down

0 comments on commit fb62d5d

Please sign in to comment.