From f867f4f0c83b8b26de5466011839491ab55b362d Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Wed, 23 Jan 2013 12:42:39 -0700 Subject: [PATCH] --- yaml --- r: 354169 b: refs/heads/master c: 694dcf501c35b6afcbc90ae3b4f3fea0b59f9888 h: refs/heads/master i: 354167: 5cf4db9dc52303ff4008d2a4c2a0104a5794328f v: v3 --- [refs] | 2 +- .../staging/comedi/drivers/addi_apci_3501.c | 29 +++++++------------ 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/[refs] b/[refs] index efd0c53f70ad..b750ef27be6b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 94f68357f219b69173ea7b62ab4f903f8edf03c5 +refs/heads/master: 694dcf501c35b6afcbc90ae3b4f3fea0b59f9888 diff --git a/trunk/drivers/staging/comedi/drivers/addi_apci_3501.c b/trunk/drivers/staging/comedi/drivers/addi_apci_3501.c index 942386f3f91e..6e331d4330af 100644 --- a/trunk/drivers/staging/comedi/drivers/addi_apci_3501.c +++ b/trunk/drivers/staging/comedi/drivers/addi_apci_3501.c @@ -225,7 +225,7 @@ static int apci3501_auto_attach(struct comedi_device *dev, struct addi_private *devpriv; struct comedi_subdevice *s; int ao_n_chan; - int ret, n_subdevices; + int ret; dev->board_name = dev->driver->driver_name; @@ -250,17 +250,12 @@ static int apci3501_auto_attach(struct comedi_device *dev, dev->irq = pcidev->irq; } - n_subdevices = 7; - ret = comedi_alloc_subdevices(dev, n_subdevices); + ret = comedi_alloc_subdevices(dev, 5); if (ret) return ret; - /* Allocate and Initialise AI Subdevice Structures */ + /* Initialize the analog output subdevice */ s = &dev->subdevices[0]; - s->type = COMEDI_SUBD_UNUSED; - - /* Allocate and Initialise AO Subdevice Structures */ - s = &dev->subdevices[1]; if (ao_n_chan) { s->type = COMEDI_SUBD_AO; s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON; @@ -273,8 +268,8 @@ static int apci3501_auto_attach(struct comedi_device *dev, s->type = COMEDI_SUBD_UNUSED; } - /* Allocate and Initialise DI Subdevice Structures */ - s = &dev->subdevices[2]; + /* Initialize the digital input subdevice */ + s = &dev->subdevices[1]; s->type = COMEDI_SUBD_DI; s->subdev_flags = SDF_READABLE; s->n_chan = 2; @@ -283,7 +278,7 @@ static int apci3501_auto_attach(struct comedi_device *dev, s->insn_bits = apci3501_di_insn_bits; /* Initialize the digital output subdevice */ - s = &dev->subdevices[3]; + s = &dev->subdevices[2]; s->type = COMEDI_SUBD_DO; s->subdev_flags = SDF_WRITEABLE; s->n_chan = 2; @@ -291,8 +286,8 @@ static int apci3501_auto_attach(struct comedi_device *dev, s->range_table = &range_digital; s->insn_bits = apci3501_do_insn_bits; - /* Allocate and Initialise Timer Subdevice Structures */ - s = &dev->subdevices[4]; + /* Initialize the timer/watchdog subdevice */ + s = &dev->subdevices[3]; s->type = COMEDI_SUBD_TIMER; s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON; s->n_chan = 1; @@ -303,12 +298,8 @@ static int apci3501_auto_attach(struct comedi_device *dev, s->insn_read = i_APCI3501_ReadTimerCounterWatchdog; s->insn_config = i_APCI3501_ConfigTimerCounterWatchdog; - /* Allocate and Initialise TTL */ - s = &dev->subdevices[5]; - s->type = COMEDI_SUBD_UNUSED; - - /* EEPROM */ - s = &dev->subdevices[6]; + /* Initialize the eeprom subdevice */ + s = &dev->subdevices[4]; s->type = COMEDI_SUBD_MEMORY; s->subdev_flags = SDF_READABLE | SDF_INTERNAL; s->n_chan = 256;