}
ret = comedi_alloc_subdevices(dev, i);
- if (ret < 0)
+ if (ret)
return ret;
printk(KERN_INFO "comedi%d: 8255:", dev->minor);
const struct boardtype *board = comedi_board(dev);
struct comedi_subdevice *s;
int iobase, iorange;
+ int ret;
iobase = it->options[0];
iorange = board->io_range;
dev->iobase = iobase;
dev->irq = 0;
- if (comedi_alloc_subdevices(dev, 3) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 3);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
/* Relays outputs */
} else {
n_subdevices = 7;
ret = comedi_alloc_subdevices(dev, n_subdevices);
- if (ret < 0)
+ if (ret)
return ret;
/* Allocate and Initialise AI Subdevice Structures */
int n_subdevices = 9;
ret = comedi_alloc_subdevices(dev, n_subdevices);
- if (ret < 0)
+ if (ret)
return;
/* Allocate and Initialise Timer Subdevice Structures */
dev->iobase = io_base;
dev->board_name = thisboard->name;
- if (comedi_alloc_subdevices(dev, 2) < 0)
- return -ENOMEM;
+ retval = comedi_alloc_subdevices(dev, 2);
+ if (retval)
+ return retval;
s = dev->subdevices + 0;
/* analog output subdevice */
struct comedi_devconfig *it)
{
struct comedi_subdevice *s;
+ int ret;
printk(KERN_INFO "comedi%d: adl_pci7230\n", dev->minor);
if (alloc_private(dev, sizeof(struct adl_pci7230_private)) < 0)
return -ENOMEM;
- if (comedi_alloc_subdevices(dev, 2) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 2);
+ if (ret)
+ return ret;
devpriv->pci_dev = adl_pci7230_find_pci(dev, it);
if (!devpriv->pci_dev)
if (alloc_private(dev, sizeof(struct adl_pci7296_private)) < 0)
return -ENOMEM;
- if (comedi_alloc_subdevices(dev, 4) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 4);
+ if (ret)
+ return ret;
devpriv->pci_dev = adl_pci7296_find_pci(dev, it);
if (!devpriv->pci_dev)
struct comedi_devconfig *it)
{
struct comedi_subdevice *s;
+ int ret;
printk(KERN_INFO "comedi%d: attach adl_pci7432\n", dev->minor);
if (alloc_private(dev, sizeof(struct adl_pci7432_private)) < 0)
return -ENOMEM;
- if (comedi_alloc_subdevices(dev, 2) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 2);
+ if (ret)
+ return ret;
devpriv->pci_dev = adl_pci7432_find_pci(dev, it);
if (!devpriv->pci_dev)
struct comedi_devconfig *it)
{
struct comedi_subdevice *s;
+ int ret;
printk(KERN_INFO "comedi: attempt to attach...\n");
printk(KERN_INFO "comedi%d: adl_pci8164\n", dev->minor);
if (alloc_private(dev, sizeof(struct adl_pci8164_private)) < 0)
return -ENOMEM;
- if (comedi_alloc_subdevices(dev, 4) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 4);
+ if (ret)
+ return ret;
devpriv->pci_dev = adl_pci8164_find_pci(dev, it);
if (!devpriv->pci_dev)
/* TODO: Add external multiplexer setup (according to option[2]). */
error = comedi_alloc_subdevices(dev, 4);
- if (error < 0)
+ if (error)
return error;
subdevice = dev->subdevices + 0;
/* Enable parity check for parity error */
ret = comedi_alloc_subdevices(dev, 4);
- if (ret < 0)
+ if (ret)
return ret;
s = dev->subdevices + 0;
struct comedi_subdevice *s;
unsigned long iobase;
int unipolar, differential;
+ int ret;
iobase = it->options[0];
unipolar = it->options[1];
devpriv->last_channel = -1;
devpriv->last_range = -1;
- if (comedi_alloc_subdevices(dev, 3) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 3);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
/* analog input subdevice */
n_subdevices++;
ret = comedi_alloc_subdevices(dev, n_subdevices);
- if (ret < 0)
+ if (ret)
return ret;
pci1710_reset(dev);
n_subdevices++;
ret = comedi_alloc_subdevices(dev, n_subdevices);
- if (ret < 0)
+ if (ret)
return ret;
pci1723_reset(dev);
}
ret = comedi_alloc_subdevices(dev, n_subdevices);
- if (ret < 0)
+ if (ret)
return ret;
subdev = 0;
const struct aio12_8_boardtype *board = comedi_board(dev);
int iobase;
struct comedi_subdevice *s;
+ int ret;
iobase = it->options[0];
if (!request_region(iobase, 24, "aio_aio12_8")) {
if (alloc_private(dev, sizeof(struct aio12_8_private)) < 0)
return -ENOMEM;
- if (comedi_alloc_subdevices(dev, 3) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 3);
+ if (ret)
+ return ret;
s = &dev->subdevices[0];
s->type = COMEDI_SUBD_AI;
const struct aio_iiro_16_board *board = comedi_board(dev);
int iobase;
struct comedi_subdevice *s;
+ int ret;
printk(KERN_INFO "comedi%d: aio_iiro_16: ", dev->minor);
if (alloc_private(dev, sizeof(struct aio_iiro_16_private)) < 0)
return -ENOMEM;
- if (comedi_alloc_subdevices(dev, 2) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 2);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
s->type = COMEDI_SUBD_DIO;
devpriv->intr_sd = -1;
dev->iobase = iobase;
dev->board_name = thisboard->name;
+
ret = comedi_alloc_subdevices(dev, layout->n_subdevs);
- if (ret < 0)
+ if (ret)
return ret;
+
for (n = 0; n < dev->n_subdevices; n++) {
s = &dev->subdevices[n];
switch (layout->sdtype[n]) {
dev->iobase = iobase;
ret = comedi_alloc_subdevices(dev, 2);
- if (ret < 0)
+ if (ret)
return ret;
s = dev->subdevices + 0;
dev->iobase = iobase;
ret = comedi_alloc_subdevices(dev, 1);
- if (ret < 0)
+ if (ret)
return ret;
s = dev->subdevices + 0;
dev->iobase + PCI224_DACCON);
ret = comedi_alloc_subdevices(dev, 1);
- if (ret < 0)
+ if (ret)
return ret;
s = dev->subdevices + 0;
devpriv->pci_dev->irq);
}
- if (comedi_alloc_subdevices(dev, 3) < 0)
- return -ENOMEM;
+ rc = comedi_alloc_subdevices(dev, 3);
+ if (rc)
+ return rc;
+
s = dev->subdevices + 0;
/* analog input subdevice */
s->type = COMEDI_SUBD_AI;
dev->board_name = "c6xdigio";
result = comedi_alloc_subdevices(dev, 2);
- if (result < 0)
+ if (result)
return result;
/* Make sure that PnP ports get activated */
if (alloc_private(dev, sizeof(struct das16cs_private)) < 0)
return -ENOMEM;
- if (comedi_alloc_subdevices(dev, 4) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 4);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
dev->read_subdev = s;
struct pci_dev *pcidev = NULL;
int index;
int i;
+ int ret;
/*
* Allocate the private structure area.
/* Initialize dev->board_name */
dev->board_name = thisboard->name;
- if (comedi_alloc_subdevices(dev, 7) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 7);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
/* analog input subdevice */
struct comedi_subdevice *s;
void __iomem *dio_8255_iobase;
int i;
+ int ret;
- if (comedi_alloc_subdevices(dev, 10) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 10);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
/* analog input subdevice */
struct comedi_subdevice *s;
struct pci_dev *pcidev = NULL;
int index;
-
+ int ret;
/*
* Allocate the private structure area.
*/
dev->board_name = thisboard->name;
- if (comedi_alloc_subdevices(dev, 3) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 3);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
/* analog output subdevice */
struct pci_dev *pcidev = NULL;
int index;
int i;
+ int ret;
/*
* Allocate the private structure area. alloc_private() is a
pci_resource_start(devpriv->pci_dev,
pcidio_boards[index].dioregs_badrindex);
- if (comedi_alloc_subdevices(dev, thisboard->n_8255) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, thisboard->n_8255);
+ if (ret)
+ return ret;
for (i = 0; i < thisboard->n_8255; i++) {
subdev_8255_init(dev, dev->subdevices + i,
struct comedi_subdevice *s;
struct pci_dev *pcidev = NULL;
int index;
+ int ret;
/* int i; */
/*
/* Initialize dev->board_name */
dev->board_name = thisboard->name;
- if (comedi_alloc_subdevices(dev, 3) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 3);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
/* dev->read_subdev=s; */
*/
dev->board_name = thisboard->name;
- if (comedi_alloc_subdevices(dev, 2) < 0)
- return -ENOMEM;
+ err = comedi_alloc_subdevices(dev, 2);
+ if (err)
+ return err;
s = dev->subdevices + 0;
struct comedi_devconfig *it)
{
struct comedi_subdevice *s;
+ int ret;
LOG_MSG("comedi%d\n", dev->minor);
*/
dev->board_name = devpriv->name;
- if (comedi_alloc_subdevices(dev, 1) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 1);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
s->type = COMEDI_SUBD_DIO;
dev->board_name = "parport";
ret = comedi_alloc_subdevices(dev, 4);
- if (ret < 0)
+ if (ret)
return ret;
+
ret = alloc_private(dev, sizeof(struct parport_private));
if (ret < 0)
return ret;
int amplitude = it->options[0];
int period = it->options[1];
int i;
+ int ret;
dev->board_name = board->name;
devpriv->uvolt_amplitude = amplitude;
devpriv->usec_period = period;
- if (comedi_alloc_subdevices(dev, 2) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 2);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
dev->read_subdev = s;
{
struct pci_dev *pcidev = NULL;
struct comedi_subdevice *s;
+ int ret;
printk("comedi%d: contec: ", dev->minor);
if (alloc_private(dev, sizeof(struct contec_private)) < 0)
return -ENOMEM;
- if (comedi_alloc_subdevices(dev, 2) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 2);
+ if (ret)
+ return ret;
for_each_pci_dev(pcidev) {
if (pcidev->vendor == PCI_VENDOR_ID_CONTEC &&
return -ENOMEM;
result = comedi_alloc_subdevices(dev, 3);
- if (result < 0)
- goto out;
+ if (result)
+ return result;
readl(devpriv->plx + 0x6c);
dev->board_name = thisboard->name;
ret = comedi_alloc_subdevices(dev, 6);
- if (ret < 0)
+ if (ret)
return ret;
s = dev->subdevices + 0;
devpriv->timer_mode = timer_mode ? 1 : 0;
ret = comedi_alloc_subdevices(dev, 5);
- if (ret < 0)
+ if (ret)
return ret;
s = dev->subdevices + 0;
}
ret = comedi_alloc_subdevices(dev, 4);
- if (ret < 0)
+ if (ret)
return ret;
s = dev->subdevices + 0;
return -ENOMEM;
}
- if (comedi_alloc_subdevices(dev, 4) < 0)
- return -ENOMEM;
+ retval = comedi_alloc_subdevices(dev, 4);
+ if (retval)
+ return retval;
/* analog input subdevice */
s = dev->subdevices + 0;
return ret;
ret = comedi_alloc_subdevices(dev, 1);
- if (ret < 0)
+ if (ret)
return ret;
/* ai subdevice */
unsigned int irq = it->options[1];
unsigned long irq_flags;
int board;
+ int ret;
dev_info(dev->hw_dev, "comedi%d: das800: io 0x%lx\n", dev->minor,
iobase);
dev->board_name = thisboard->name;
- if (comedi_alloc_subdevices(dev, 3) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 3);
+ if (ret)
+ return ret;
/* analog input subdevice */
s = dev->subdevices + 0;
if (alloc_private(dev, sizeof(struct dmm32at_private)) < 0)
return -ENOMEM;
- if (comedi_alloc_subdevices(dev, 3) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 3);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
dev->read_subdev = s;
printk("dt2801: %s at port 0x%lx", boardtype.name, iobase);
n_ai_chans = probe_number_of_ai_chans(dev);
- printk(" (ai channels = %d)", n_ai_chans);
+ printk(" (ai channels = %d)\n", n_ai_chans);
ret = comedi_alloc_subdevices(dev, 4);
- if (ret < 0)
+ if (ret)
goto out;
ret = alloc_private(dev, sizeof(struct dt2801_private));
if (ret < 0)
- goto out;
+ return ret;
dev->board_name = boardtype.name;
ret = 0;
out:
- printk("\n");
-
return ret;
}
#endif
ret = comedi_alloc_subdevices(dev, 4);
- if (ret < 0)
+ if (ret)
return ret;
ret = alloc_private(dev, sizeof(struct dt2811_private));
}
ret = comedi_alloc_subdevices(dev, 1);
- if (ret < 0)
+ if (ret)
return ret;
ret = alloc_private(dev, sizeof(struct dt2814_private));
int i;
const struct comedi_lrange *current_range_type, *voltage_range_type;
unsigned long iobase;
+ int ret;
iobase = it->options[0];
printk(KERN_INFO "comedi%d: dt2815: 0x%04lx ", dev->minor, iobase);
dev->iobase = iobase;
dev->board_name = "dt2815";
- if (comedi_alloc_subdevices(dev, 1) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 1);
+ if (ret)
+ return ret;
+
if (alloc_private(dev, sizeof(struct dt2815_private)) < 0)
return -ENOMEM;
dev->board_name = "dt2817";
ret = comedi_alloc_subdevices(dev, 1);
- if (ret < 0)
+ if (ret)
return ret;
s = dev->subdevices + 0;
return ret;
ret = comedi_alloc_subdevices(dev, 3);
- if (ret < 0)
+ if (ret)
return ret;
s = dev->subdevices + 0;
dev->irq = devpriv->pci_dev->irq;
ret = comedi_alloc_subdevices(dev, 4);
- if (ret < 0)
+ if (ret)
return ret;
s = dev->subdevices;
{
int i;
struct comedi_subdevice *s;
+ int ret;
dev->board_name = "dt9812";
devpriv->serial = it->options[0];
- if (comedi_alloc_subdevices(dev, 4) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 4);
+ if (ret)
+ return ret;
/* digital input subdevice */
s = dev->subdevices + 0;
struct pci_dev *pcidev;
unsigned int opt_bus, opt_slot;
int board_index, i;
+ int ret;
mutex_lock(&start_stop_sem);
devpriv->BADR4 = pci_resource_start(pcidev, 4);
devpriv->BADR5 = pci_resource_start(pcidev, 5);
- if (comedi_alloc_subdevices(dev, 4) < 0) {
+ ret = comedi_alloc_subdevices(dev, 4);
+ if (ret) {
mutex_unlock(&start_stop_sem);
- return -ENOMEM;
+ return ret;
}
/* analog input */
static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
unsigned long iobase;
+ int ret;
/* pointer to the subdevice: Analog in, Analog out,
(not made ->and Digital IO) */
printk(KERN_DEBUG "malloc ok\n");
#endif
- if (comedi_alloc_subdevices(dev, 2) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 2);
+ if (ret)
+ return ret;
/*
* this if the definitions of the supdevices, 2 have been defined
static int setup_subdevices(struct comedi_device *dev)
{
struct comedi_subdevice *s;
+ int ret;
- if (comedi_alloc_subdevices(dev, 1) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 1);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
/* analog input subdevice */
n_subdevices++;
ret = comedi_alloc_subdevices(dev, n_subdevices);
- if (ret < 0)
+ if (ret)
return ret;
icp_multi_reset(dev);
union pci20xxx_subdev_private *sdp;
ret = comedi_alloc_subdevices(dev, 1 + PCI20000_MODULES);
- if (ret < 0)
+ if (ret)
return ret;
ret = alloc_private(dev, sizeof(struct pci20xxx_private));
return -ENOMEM;
result = comedi_alloc_subdevices(dev, devpriv->n_channels);
- if (result < 0)
- goto out;
+ if (result)
+ return result;
dev->open = jr3_pci_open;
for (i = 0; i < devpriv->n_channels; i++) {
dev->iobase = io_base;
error = comedi_alloc_subdevices(dev, 1);
- if (error < 0)
+ if (error)
return error;
subdevice = dev->subdevices + 0;
if (result)
return result;
- if (comedi_alloc_subdevices(dev, 4) < 0)
- return -ENOMEM;
+ result = comedi_alloc_subdevices(dev, 4);
+ if (result)
+ return result;
/*=========================================================================
Analog input subdevice
me_reset(dev);
- /* device driver capabilities */
error = comedi_alloc_subdevices(dev, 3);
- if (error < 0)
+ if (error)
return error;
subdevice = dev->subdevices + 0;
{
struct comedi_subdevice *s;
unsigned long iobase;
+ int ret;
iobase = it->options[0];
printk(KERN_INFO "comedi%d: mpc624 [0x%04lx, ", dev->minor, iobase);
devpriv->ulConvertionRate = MPC624_SPEED_3_52_kHz;
}
- if (comedi_alloc_subdevices(dev, 1) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 1);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
s->type = COMEDI_SUBD_AI;
{
struct comedi_subdevice *s;
int i;
+ int ret;
printk("comedi%d: mpc8260cpm: ", dev->minor);
if (alloc_private(dev, sizeof(struct mpc8260cpm_private)) < 0)
return -ENOMEM;
- if (comedi_alloc_subdevices(dev, 4) < 0)
- return -ENOMEM;
+ ret =comedi_alloc_subdevices(dev, 4);
+ if (ret)
+ return ret;
for (i = 0; i < 4; i++) {
s = dev->subdevices + i;
else
printk(KERN_WARNING "comedi%d: no irq\n", dev->minor);
dev->board_name = "multiq3";
+
result = comedi_alloc_subdevices(dev, 5);
- if (result < 0)
+ if (result)
return result;
result = alloc_private(dev, sizeof(struct multiq3_private));
readb(devpriv->mite->daq_io_addr + ID_Register));
ret = comedi_alloc_subdevices(dev, 3);
- if (ret < 0)
+ if (ret)
return ret;
s = dev->subdevices + 0;
readb(private(dev)->mite->daq_io_addr + ID_Register));
ret = comedi_alloc_subdevices(dev, 4);
- if (ret < 0)
+ if (ret)
return ret;
s = dev->subdevices + 0;
printk(KERN_INFO " %s ", dev->board_name);
- if (comedi_alloc_subdevices(dev, 2 + NI_660X_MAX_NUM_COUNTERS) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 2 + NI_660X_MAX_NUM_COUNTERS);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
/* Old GENERAL-PURPOSE COUNTER/TIME (GPCT) subdevice, no longer used */
dev->irq = mite_irq(devpriv->mite);
printk(KERN_INFO " %s", dev->board_name);
- if (comedi_alloc_subdevices(dev, 2) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 2);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
/* analog output subdevice */
unsigned int dma = it->options[2];
static const int timeout = 2000;
int i;
+ int ret;
printk("comedi%d: %s: io 0x%lx", dev->minor, dev->driver->driver_name,
iobase);
dev->board_ptr = a2150_boards + a2150_probe(dev);
dev->board_name = thisboard->name;
- if (comedi_alloc_subdevices(dev, 1) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 1);
+ if (ret)
+ return ret;
/* analog input subdevice */
s = dev->subdevices + 0;
struct comedi_subdevice *s;
unsigned long iobase;
int ao_unipolar;
+ int ret;
iobase = it->options[0];
if (iobase == 0)
if (alloc_private(dev, sizeof(struct atao_private)) < 0)
return -ENOMEM;
- if (comedi_alloc_subdevices(dev, 4) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 4);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
/* analog output subdevice */
dev->board_name = board->name;
ret = comedi_alloc_subdevices(dev, 4);
- if (ret < 0)
+ if (ret)
return ret;
ret = alloc_private(dev, sizeof(struct atmio16d_private));
unsigned int irq = 0;
#endif
struct pcmcia_device *link;
+ int ret;
/* allocate and initialize dev->private */
if (alloc_private(dev, sizeof(struct dio700_private)) < 0)
dev->board_name = thisboard->name;
- if (comedi_alloc_subdevices(dev, 1) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 1);
+ if (ret)
+ return ret;
/* DAQCard-700 dio */
s = dev->subdevices + 0;
unsigned int irq = 0;
#endif
struct pcmcia_device *link;
+ int ret;
/* allocate and initialize dev->private */
if (alloc_private(dev, sizeof(struct dio24_private)) < 0)
dev->board_name = thisboard->name;
- if (comedi_alloc_subdevices(dev, 1) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 1);
+ if (ret)
+ return ret;
/* 8255 dio */
s = dev->subdevices + 0;
unsigned long dma_flags;
#endif
short lsb, msb;
+ int ret;
printk(KERN_ERR "comedi%d: ni_labpc: %s, io 0x%lx", dev->minor,
thisboard->name,
dev->board_name = thisboard->name;
- if (comedi_alloc_subdevices(dev, 5) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 5);
+ if (ret)
+ return ret;
/* analog input subdevice */
s = dev->subdevices + 0;
struct comedi_subdevice *s;
unsigned j;
enum ni_gpct_variant counter_variant;
+ int ret;
if (boardtype.n_aochan > MAX_N_AO_CHAN) {
printk("bug! boardtype.n_aochan > MAX_N_AO_CHAN\n");
return -EINVAL;
}
- if (comedi_alloc_subdevices(dev, NI_NUM_SUBDEVICES) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, NI_NUM_SUBDEVICES);
+ if (ret)
+ return ret;
/* analog input subdevice */
n_subdevices = 1;
ret = comedi_alloc_subdevices(dev, n_subdevices);
- if (ret < 0)
+ if (ret)
return ret;
if (!this_board->is_diodaq) {
dev->irq = irq;
ret = comedi_alloc_subdevices(dev, 4);
- if (ret < 0)
+ if (ret)
return ret;
ret = alloc_private(dev, sizeof(struct pcl711_private));
n_subdevices = 4; /* PCL-724 in 96 DIO configuration */
ret = comedi_alloc_subdevices(dev, n_subdevices);
- if (ret < 0)
+ if (ret)
return ret;
for (i = 0; i < dev->n_subdevices; i++) {
{
struct comedi_subdevice *s;
unsigned long iobase;
+ int ret;
iobase = it->options[0];
printk(KERN_INFO "comedi%d: pcl725: 0x%04lx ", dev->minor, iobase);
dev->iobase = iobase;
dev->irq = 0;
- if (comedi_alloc_subdevices(dev, 2) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 2);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
/* do */
printk("\n");
ret = comedi_alloc_subdevices(dev, 3);
- if (ret < 0)
+ if (ret)
return ret;
s = dev->subdevices + 0;
struct comedi_subdevice *s;
unsigned long iobase;
unsigned int iorange;
+ int ret;
iobase = it->options[0];
iorange = board->io_range;
dev->iobase = iobase;
dev->irq = 0;
- if (comedi_alloc_subdevices(dev, 4) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 4);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
/* Isolated do */
n_subdevices++;
ret = comedi_alloc_subdevices(dev, n_subdevices);
- if (ret < 0) {
+ if (ret) {
free_resources(dev);
return ret;
}
*/
ret = comedi_alloc_subdevices(dev, 1);
- if (ret < 0)
+ if (ret)
return ret;
s = dev->subdevices + 0;
no_dma:
ret = comedi_alloc_subdevices(dev, 4);
- if (ret < 0)
+ if (ret)
return ret;
s = dev->subdevices + 0;
n_subdevices = board->numofports;
ret = comedi_alloc_subdevices(dev, n_subdevices);
- if (ret < 0)
+ if (ret)
return ret;
for (i = 0; i < dev->n_subdevices; i++) {
{
struct comedi_subdevice *s;
unsigned long iobase;
+ int ret;
iobase = it->options[0];
printk(KERN_INFO "comedi%d: pcm3730: 0x%04lx ", dev->minor, iobase);
dev->iobase = dev->iobase;
dev->irq = 0;
- if (comedi_alloc_subdevices(dev, 6) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 6);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
s->type = COMEDI_SUBD_DO;
dev->iobase = iobase;
ret = comedi_alloc_subdevices(dev, 1);
- if (ret < 0)
+ if (ret)
return ret;
ret = alloc_private(dev, sizeof(struct pcmad_priv_struct));
const struct pcmda12_board *board = comedi_board(dev);
struct comedi_subdevice *s;
unsigned long iobase;
+ int ret;
iobase = it->options[0];
printk(KERN_INFO
devpriv->simultaneous_xfer_mode = it->options[1];
- if (comedi_alloc_subdevices(dev, 1) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 1);
+ if (ret)
+ return ret;
s = dev->subdevices;
s->private = NULL;
thisasic_chanct = 0;
unsigned long iobase;
unsigned int irq[MAX_ASICS];
+ int ret;
iobase = it->options[0];
irq[0] = it->options[1];
return -ENOMEM;
}
- if (comedi_alloc_subdevices(dev, n_subdevs) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, n_subdevs);
+ if (ret)
+ return ret;
/* First, AI */
sdev_no = 0;
int sdev_no, chans_left, n_subdevs, port, asic, thisasic_chanct = 0;
unsigned long iobase;
unsigned int irq[MAX_ASICS];
+ int ret;
iobase = it->options[0];
irq[0] = it->options[1];
return -ENOMEM;
}
- if (comedi_alloc_subdevices(dev, n_subdevs) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, n_subdevs);
+ if (ret)
+ return ret;
port = 0;
asic = 0;
struct comedi_subdevice *s;
unsigned long iobase;
unsigned int iosize;
+ int ret;
iobase = it->options[0];
printk(KERN_INFO "comedi%d: poc: using %s iobase 0x%lx\n", dev->minor,
}
dev->iobase = iobase;
- if (comedi_alloc_subdevices(dev, 1) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 1);
+ if (ret)
+ return ret;
+
if (alloc_private(dev, sizeof(unsigned int) * board->n_chan) < 0)
return -ENOMEM;
dev->iobase = local->link->resource[0]->start;
ret = comedi_alloc_subdevices(dev, 4);
- if (ret < 0)
+ if (ret)
return ret;
printk(KERN_INFO "comedi%d: attaching daqp%d (io 0x%04lx)\n",
/* Show board configuration */
printk(KERN_INFO "%s:", dev->board_name);
- if (comedi_alloc_subdevices(dev, 4) < 0)
- return -ENOMEM;
-
+ ret = comedi_alloc_subdevices(dev, 4);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
dev->read_subdev = s;
dev->board_name = board->name;
ret = comedi_alloc_subdevices(dev, 4);
- if (ret < 0)
+ if (ret)
return ret;
ret = alloc_private(dev, sizeof(struct rti800_private));
struct comedi_subdevice *s;
int i;
unsigned long iobase;
+ int ret;
iobase = it->options[0];
printk(KERN_INFO "comedi%d: rti802: 0x%04lx ", dev->minor, iobase);
dev->board_name = "rti802";
- if (comedi_alloc_subdevices(dev, 1) < 0
- || alloc_private(dev, sizeof(struct rti802_private))) {
+ if (alloc_private(dev, sizeof(struct rti802_private)))
return -ENOMEM;
- }
+
+ ret = comedi_alloc_subdevices(dev, 1);
+ if (ret)
+ return ret;
s = dev->subdevices;
/* ao subdevice */
struct comedi_subdevice *s;
int iobase;
int i, n;
+ int ret;
/* short value; */
/* int subdev_channel = 0; */
union cmReg cmReg;
if (alloc_private(dev, sizeof(struct s526_private)) < 0)
return -ENOMEM;
- if (comedi_alloc_subdevices(dev, 4) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 4);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
/* GENERAL-PURPOSE COUNTER/TIME (GPCT) */
dev->board_ptr = s626_boards;
dev->board_name = thisboard->name;
- if (comedi_alloc_subdevices(dev, 6) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 6);
+ if (ret)
+ return ret;
dev->iobase = (unsigned long)devpriv->base_addr;
dev->irq = devpriv->pdev->irq;
{
const struct serial2002_board *board = comedi_board(dev);
struct comedi_subdevice *s;
+ int ret;
dev_dbg(dev->hw_dev, "comedi%d: attached\n", dev->minor);
dev->board_name = board->name;
dev_dbg(dev->hw_dev, "/dev/ttyS%d @ %d\n", devpriv->port,
devpriv->speed);
- if (comedi_alloc_subdevices(dev, 5) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 5);
+ if (ret)
+ return ret;
/* digital input subdevice */
s = dev->subdevices + 0;
static int skel_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
struct comedi_subdevice *s;
+ int ret;
pr_info("comedi%d: skel: ", dev->minor);
if (alloc_private(dev, sizeof(struct skel_private)) < 0)
return -ENOMEM;
- if (comedi_alloc_subdevices(dev, 3) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 3);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
/* dev->read_subdev=s; */
{
const struct dnp_board *board = comedi_board(dev);
struct comedi_subdevice *s;
+ int ret;
printk(KERN_INFO "comedi%d: dnp: ", dev->minor);
if (alloc_private(dev, sizeof(struct dnp_private_data)) < 0)
return -ENOMEM;
- if (comedi_alloc_subdevices(dev, 1) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, 1);
+ if (ret)
+ return ret;
s = dev->subdevices + 0;
/* digital i/o subdevice */
{
int iobase, i, n_subd;
int id, num, ba;
+ int ret;
iobase = it->options[0];
return -1;
}
- if (comedi_alloc_subdevices(dev, n_subd) < 0)
- return -ENOMEM;
+ ret = comedi_alloc_subdevices(dev, n_subd);
+ if (ret)
+ return ret;
/* initializing each of for same subdevices */
for (i = 0; i < n_subd; i++, iobase += UNIOXX5_SUBDEV_ODDS) {
}
ret = comedi_alloc_subdevices(dev, n_subdevs);
- if (ret < 0) {
+ if (ret) {
up(&udev->sem);
return ret;
}
dev->board_name = BOARDNAME;
ret = comedi_alloc_subdevices(dev, 1);
- if (ret < 0) {
+ if (ret) {
up(&(usbduxfastsub[index].sem));
up(&start_stop_sem);
return ret;
}
ret = comedi_alloc_subdevices(dev, n_subdevs);
- if (ret < 0) {
+ if (ret) {
up(&udev->sem);
up(&start_stop_sem);
return ret;
int n_subd;
struct comedi_subdevice *s;
int minor;
+ int ret;
mutex_lock(&glb_mutex);
else
n_subd = 6;
- if (comedi_alloc_subdevices(cdev, n_subd) < 0) {
+ ret = comedi_alloc_subdevices(cdev, n_subd);
+ if (ret) {
up(&dev->limit_sem);
mutex_unlock(&glb_mutex);
- return -ENOMEM;
+ return ret;
}
/* Analog input subdevice */