return info->device->write_subdev;
}
+int comedi_alloc_subdevices(struct comedi_device *, unsigned int);
+
void comedi_device_detach(struct comedi_device *dev);
int comedi_device_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
/* some silly little inline functions */
-static inline int alloc_subdevices(struct comedi_device *dev,
- unsigned int num_subdevices)
-{
- unsigned i;
-
- dev->n_subdevices = num_subdevices;
- dev->subdevices =
- kcalloc(num_subdevices, sizeof(struct comedi_subdevice),
- GFP_KERNEL);
- if (!dev->subdevices)
- return -ENOMEM;
- for (i = 0; i < num_subdevices; ++i) {
- dev->subdevices[i].device = dev;
- dev->subdevices[i].async_dma_dir = DMA_NONE;
- spin_lock_init(&dev->subdevices[i].spin_lock);
- dev->subdevices[i].minor = -1;
- }
- return 0;
-}
-
static inline int alloc_private(struct comedi_device *dev, int size)
{
dev->private = kzalloc(size, GFP_KERNEL);
struct comedi_driver *comedi_drivers;
+int comedi_alloc_subdevices(struct comedi_device *dev,
+ unsigned int num_subdevices)
+{
+ unsigned i;
+
+ dev->n_subdevices = num_subdevices;
+ dev->subdevices =
+ kcalloc(num_subdevices, sizeof(struct comedi_subdevice),
+ GFP_KERNEL);
+ if (!dev->subdevices)
+ return -ENOMEM;
+ for (i = 0; i < num_subdevices; ++i) {
+ dev->subdevices[i].device = dev;
+ dev->subdevices[i].async_dma_dir = DMA_NONE;
+ spin_lock_init(&dev->subdevices[i].spin_lock);
+ dev->subdevices[i].minor = -1;
+ }
+ return 0;
+}
+EXPORT_SYMBOL_GPL(comedi_alloc_subdevices);
+
static void cleanup_device(struct comedi_device *dev)
{
int i;
return -EINVAL;
}
- ret = alloc_subdevices(dev, i);
+ ret = comedi_alloc_subdevices(dev, i);
if (ret < 0) {
/* FIXME this printk call should give a proper message, the
* below line just maintains previous functionality */
dev->iobase = iobase;
dev->irq = 0;
- if (alloc_subdevices(dev, 3) < 0)
+ if (comedi_alloc_subdevices(dev, 3) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
} else {
/* Update-0.7.57->0.7.68dev->n_subdevices = 7; */
n_subdevices = 7;
- ret = alloc_subdevices(dev, n_subdevices);
+ ret = comedi_alloc_subdevices(dev, n_subdevices);
if (ret < 0)
return ret;
int n_subdevices = 9;
/* Update-0.7.57->0.7.68dev->n_subdevices = 9; */
- ret = alloc_subdevices(dev, n_subdevices);
+ ret = comedi_alloc_subdevices(dev, n_subdevices);
if (ret < 0)
return;
dev->iobase = io_base;
dev->board_name = thisboard->name;
- if (alloc_subdevices(dev, 2) < 0)
+ if (comedi_alloc_subdevices(dev, 2) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
if (alloc_private(dev, sizeof(struct adl_pci7230_private)) < 0)
return -ENOMEM;
- if (alloc_subdevices(dev, 2) < 0)
+ if (comedi_alloc_subdevices(dev, 2) < 0)
return -ENOMEM;
devpriv->pci_dev = adl_pci7230_find_pci(dev, it);
if (alloc_private(dev, sizeof(struct adl_pci7296_private)) < 0)
return -ENOMEM;
- if (alloc_subdevices(dev, 4) < 0)
+ if (comedi_alloc_subdevices(dev, 4) < 0)
return -ENOMEM;
devpriv->pci_dev = adl_pci7296_find_pci(dev, it);
if (alloc_private(dev, sizeof(struct adl_pci7432_private)) < 0)
return -ENOMEM;
- if (alloc_subdevices(dev, 2) < 0)
+ if (comedi_alloc_subdevices(dev, 2) < 0)
return -ENOMEM;
devpriv->pci_dev = adl_pci7432_find_pci(dev, it);
if (alloc_private(dev, sizeof(struct adl_pci8164_private)) < 0)
return -ENOMEM;
- if (alloc_subdevices(dev, 4) < 0)
+ if (comedi_alloc_subdevices(dev, 4) < 0)
return -ENOMEM;
devpriv->pci_dev = adl_pci8164_find_pci(dev, it);
/* TODO: Add external multiplexer setup (according to option[2]). */
- error = alloc_subdevices(dev, 4);
+ error = comedi_alloc_subdevices(dev, 4);
if (error < 0)
return error;
pci_write_config_word(devpriv->pcidev, PCI_COMMAND, u16w | 64);
/* Enable parity check for parity error */
- ret = alloc_subdevices(dev, 4);
+ ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;
* Allocate the subdevice structures. alloc_subdevice() is a
* convenient macro defined in comedidev.h.
*/
- if (alloc_subdevices(dev, 3) < 0)
+ if (comedi_alloc_subdevices(dev, 3) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
if (this_board->n_counter)
n_subdevices++;
- ret = alloc_subdevices(dev, n_subdevices);
+ ret = comedi_alloc_subdevices(dev, n_subdevices);
if (ret < 0)
return ret;
if (this_board->n_diochan)
n_subdevices++;
- ret = alloc_subdevices(dev, n_subdevices);
+ ret = comedi_alloc_subdevices(dev, n_subdevices);
if (ret < 0) {
printk(" - Allocation failed!\n");
return ret;
n_subdevices++;
}
- ret = alloc_subdevices(dev, n_subdevices);
+ ret = comedi_alloc_subdevices(dev, n_subdevices);
if (ret < 0)
return ret;
if (alloc_private(dev, sizeof(struct aio12_8_private)) < 0)
return -ENOMEM;
- if (alloc_subdevices(dev, 3) < 0)
+ if (comedi_alloc_subdevices(dev, 3) < 0)
return -ENOMEM;
s = &dev->subdevices[0];
if (alloc_private(dev, sizeof(struct aio_iiro_16_private)) < 0)
return -ENOMEM;
- if (alloc_subdevices(dev, 2) < 0)
+ if (comedi_alloc_subdevices(dev, 2) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
devpriv->intr_sd = -1;
dev->iobase = iobase;
dev->board_name = thisboard->name;
- ret = alloc_subdevices(dev, layout->n_subdevs);
+ ret = comedi_alloc_subdevices(dev, layout->n_subdevs);
if (ret < 0) {
dev_err(dev->class_dev, "error! out of memory!\n");
return ret;
dev->board_name = thisboard->name;
dev->iobase = iobase;
- ret = alloc_subdevices(dev, 2);
+ ret = comedi_alloc_subdevices(dev, 2);
if (ret < 0) {
dev_err(dev->class_dev, "error! out of memory!\n");
return ret;
dev->board_name = thisboard->name;
dev->iobase = iobase;
- ret = alloc_subdevices(dev, 1);
+ ret = comedi_alloc_subdevices(dev, 1);
if (ret < 0) {
dev_err(dev->class_dev, "error! out of memory!\n");
return ret;
dev->iobase + PCI224_DACCON);
/* Allocate subdevices. There is only one! */
- ret = alloc_subdevices(dev, 1);
+ ret = comedi_alloc_subdevices(dev, 1);
if (ret < 0) {
dev_err(dev->class_dev, "error! out of memory!\n");
return ret;
* Allocate the subdevice structures. alloc_subdevice() is a
* convenient macro defined in comedidev.h.
*/
- if (alloc_subdevices(dev, 3) < 0)
+ if (comedi_alloc_subdevices(dev, 3) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
/* analog input subdevice */
dev->iobase = iobase;
dev->board_name = "c6xdigio";
- result = alloc_subdevices(dev, 2); /* 3 with encoder_init write */
+ /* 3 subdevices with encoder_init write */
+ result = comedi_alloc_subdevices(dev, 2);
if (result < 0)
return result;
if (alloc_private(dev, sizeof(struct das16cs_private)) < 0)
return -ENOMEM;
- if (alloc_subdevices(dev, 4) < 0)
+ if (comedi_alloc_subdevices(dev, 4) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
/*
* Allocate the subdevice structures.
*/
- if (alloc_subdevices(dev, 7) < 0)
+ if (comedi_alloc_subdevices(dev, 7) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
void __iomem *dio_8255_iobase;
int i;
- if (alloc_subdevices(dev, 10) < 0)
+ if (comedi_alloc_subdevices(dev, 10) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
/*
* Allocate the subdevice structures.
*/
- if (alloc_subdevices(dev, 3) < 0)
+ if (comedi_alloc_subdevices(dev, 3) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
* Allocate the subdevice structures. alloc_subdevice() is a
* convenient macro defined in comedidev.h.
*/
- if (alloc_subdevices(dev, thisboard->n_8255) < 0)
+ if (comedi_alloc_subdevices(dev, thisboard->n_8255) < 0)
return -ENOMEM;
for (i = 0; i < thisboard->n_8255; i++) {
* Allocate the subdevice structures. alloc_subdevice() is a
* convenient macro defined in comedidev.h.
*/
- if (alloc_subdevices(dev, 3) < 0)
+ if (comedi_alloc_subdevices(dev, 3) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
* Allocate the subdevice structures. alloc_subdevice() is a
* convenient macro defined in comedidev.h.
*/
- if (alloc_subdevices(dev, 2) < 0)
+ if (comedi_alloc_subdevices(dev, 2) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
* Allocate the subdevice structures. alloc_subdevice() is a
* convenient macro defined in comedidev.h.
*/
- if (alloc_subdevices(dev, 1) < 0)
+ if (comedi_alloc_subdevices(dev, 1) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
}
dev->board_name = "parport";
- ret = alloc_subdevices(dev, 4);
+ ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;
ret = alloc_private(dev, sizeof(struct parport_private));
devpriv->usec_period = period;
dev->n_subdevices = 2;
- if (alloc_subdevices(dev, dev->n_subdevices) < 0)
+ if (comedi_alloc_subdevices(dev, dev->n_subdevices) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
if (alloc_private(dev, sizeof(struct contec_private)) < 0)
return -ENOMEM;
- if (alloc_subdevices(dev, 2) < 0)
+ if (comedi_alloc_subdevices(dev, 2) < 0)
return -ENOMEM;
for_each_pci_dev(pcidev) {
if (!devpriv->plx || !devpriv->daq)
return -ENOMEM;
- result = alloc_subdevices(dev, 3);
+ result = comedi_alloc_subdevices(dev, 3);
if (result < 0)
goto out;
dev->board_name = thisboard->name;
- ret = alloc_subdevices(dev, 6);
+ ret = comedi_alloc_subdevices(dev, 6);
if (ret < 0)
return ret;
}
devpriv->timer_mode = timer_mode ? 1 : 0;
- ret = alloc_subdevices(dev, 5);
+ ret = comedi_alloc_subdevices(dev, 5);
if (ret < 0)
return ret;
return -EINVAL;
}
- ret = alloc_subdevices(dev, 4);
+ ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;
return -ENOMEM;
}
- if (alloc_subdevices(dev, 4) < 0)
+ if (comedi_alloc_subdevices(dev, 4) < 0)
return -ENOMEM;
/* analog input subdevice */
if (ret < 0)
return ret;
- ret = alloc_subdevices(dev, 1);
+ ret = comedi_alloc_subdevices(dev, 1);
if (ret < 0)
return ret;
dev->board_name = thisboard->name;
- if (alloc_subdevices(dev, 3) < 0)
+ if (comedi_alloc_subdevices(dev, 3) < 0)
return -ENOMEM;
/* analog input subdevice */
* Allocate the subdevice structures. alloc_subdevice() is a
* convenient macro defined in comedidev.h.
*/
- if (alloc_subdevices(dev, 3) < 0)
+ if (comedi_alloc_subdevices(dev, 3) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
n_ai_chans = probe_number_of_ai_chans(dev);
printk(" (ai channels = %d)", n_ai_chans);
- ret = alloc_subdevices(dev, 4);
+ ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
goto out;
}
#endif
- ret = alloc_subdevices(dev, 4);
+ ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;
#endif
}
- ret = alloc_subdevices(dev, 1);
+ ret = comedi_alloc_subdevices(dev, 1);
if (ret < 0)
return ret;
dev->iobase = iobase;
dev->board_name = "dt2815";
- if (alloc_subdevices(dev, 1) < 0)
+ if (comedi_alloc_subdevices(dev, 1) < 0)
return -ENOMEM;
if (alloc_private(dev, sizeof(struct dt2815_private)) < 0)
return -ENOMEM;
dev->iobase = iobase;
dev->board_name = "dt2817";
- ret = alloc_subdevices(dev, 1);
+ ret = comedi_alloc_subdevices(dev, 1);
if (ret < 0)
return ret;
if (ret < 0)
return ret;
- ret = alloc_subdevices(dev, 3);
+ ret = comedi_alloc_subdevices(dev, 3);
if (ret < 0)
return ret;
}
dev->irq = devpriv->pci_dev->irq;
- ret = alloc_subdevices(dev, 4);
+ ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;
devpriv->serial = it->options[0];
/* Allocate subdevices */
- if (alloc_subdevices(dev, 4) < 0)
+ if (comedi_alloc_subdevices(dev, 4) < 0)
return -ENOMEM;
/* digital input subdevice */
devpriv->BADR4 = pci_resource_start(pcidev, 4);
devpriv->BADR5 = pci_resource_start(pcidev, 5);
- if (alloc_subdevices(dev, 4) < 0) {
+ if (comedi_alloc_subdevices(dev, 4) < 0) {
printk(KERN_ERR "comedi: dyna_pci10xx: "
"failed allocating subdevices\n");
mutex_unlock(&start_stop_sem);
printk(KERN_DEBUG "malloc ok\n");
#endif
- if (alloc_subdevices(dev, 2) < 0)
+ if (comedi_alloc_subdevices(dev, 2) < 0)
return -ENOMEM;
/*
{
struct comedi_subdevice *s;
- if (alloc_subdevices(dev, 1) < 0)
+ if (comedi_alloc_subdevices(dev, 1) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
if (this_board->n_ctrs)
n_subdevices++;
- ret = alloc_subdevices(dev, n_subdevices);
+ ret = comedi_alloc_subdevices(dev, n_subdevices);
if (ret < 0)
return ret;
struct comedi_subdevice *s;
union pci20xxx_subdev_private *sdp;
- ret = alloc_subdevices(dev, 1 + PCI20000_MODULES);
+ ret = comedi_alloc_subdevices(dev, 1 + PCI20000_MODULES);
if (ret < 0)
return ret;
if (!devpriv->iobase)
return -ENOMEM;
- result = alloc_subdevices(dev, devpriv->n_channels);
+ result = comedi_alloc_subdevices(dev, devpriv->n_channels);
if (result < 0)
goto out;
dev->iobase = io_base;
/* allocate the subdevice structures */
- error = alloc_subdevices(dev, 1);
+ error = comedi_alloc_subdevices(dev, 1);
if (error < 0)
return error;
* convenient macro defined in comedidev.h. It relies on
* n_subdevices being set correctly.
*/
- if (alloc_subdevices(dev, 4) < 0)
+ if (comedi_alloc_subdevices(dev, 4) < 0)
return -ENOMEM;
/*=========================================================================
me_reset(dev);
/* device driver capabilities */
- error = alloc_subdevices(dev, 3);
+ error = comedi_alloc_subdevices(dev, 3);
if (error < 0)
return error;
}
/* Subdevices structures */
- if (alloc_subdevices(dev, 1) < 0)
+ if (comedi_alloc_subdevices(dev, 1) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
if (alloc_private(dev, sizeof(struct mpc8260cpm_private)) < 0)
return -ENOMEM;
- if (alloc_subdevices(dev, 4) < 0)
+ if (comedi_alloc_subdevices(dev, 4) < 0)
return -ENOMEM;
for (i = 0; i < 4; i++) {
else
printk(KERN_WARNING "comedi%d: no irq\n", dev->minor);
dev->board_name = "multiq3";
- result = alloc_subdevices(dev, 5);
+ result = comedi_alloc_subdevices(dev, 5);
if (result < 0)
return result;
printk(KERN_INFO "comedi board: %s, ID=0x%02x\n", dev->board_name,
readb(devpriv->mite->daq_io_addr + ID_Register));
- ret = alloc_subdevices(dev, 3);
+ ret = comedi_alloc_subdevices(dev, 3);
if (ret < 0)
return ret;
printk(KERN_INFO " ID=0x%02x",
readb(private(dev)->mite->daq_io_addr + ID_Register));
- ret = alloc_subdevices(dev, 4);
+ ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;
dev->n_subdevices = 2 + NI_660X_MAX_NUM_COUNTERS;
- if (alloc_subdevices(dev, dev->n_subdevices) < 0)
+ if (comedi_alloc_subdevices(dev, dev->n_subdevices) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
dev->irq = mite_irq(devpriv->mite);
printk(KERN_INFO " %s", dev->board_name);
- if (alloc_subdevices(dev, 2) < 0)
+ if (comedi_alloc_subdevices(dev, 2) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
dev->board_ptr = a2150_boards + a2150_probe(dev);
dev->board_name = thisboard->name;
- if (alloc_subdevices(dev, 1) < 0)
+ if (comedi_alloc_subdevices(dev, 1) < 0)
return -ENOMEM;
/* analog input subdevice */
if (alloc_private(dev, sizeof(struct atao_private)) < 0)
return -ENOMEM;
- if (alloc_subdevices(dev, 4) < 0)
+ if (comedi_alloc_subdevices(dev, 4) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
dev->board_name = board->name;
- ret = alloc_subdevices(dev, 4);
+ ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;
dev->board_name = thisboard->name;
- if (alloc_subdevices(dev, 1) < 0)
+ if (comedi_alloc_subdevices(dev, 1) < 0)
return -ENOMEM;
/* DAQCard-700 dio */
dev->board_name = thisboard->name;
- if (alloc_subdevices(dev, 1) < 0)
+ if (comedi_alloc_subdevices(dev, 1) < 0)
return -ENOMEM;
/* 8255 dio */
dev->board_name = thisboard->name;
- if (alloc_subdevices(dev, 5) < 0)
+ if (comedi_alloc_subdevices(dev, 5) < 0)
return -ENOMEM;
/* analog input subdevice */
return -EINVAL;
}
- if (alloc_subdevices(dev, NI_NUM_SUBDEVICES) < 0)
+ if (comedi_alloc_subdevices(dev, NI_NUM_SUBDEVICES) < 0)
return -ENOMEM;
/* analog input subdevice */
else
n_subdevices = 1;
- ret = alloc_subdevices(dev, n_subdevices);
+ ret = comedi_alloc_subdevices(dev, n_subdevices);
if (ret < 0)
return ret;
}
dev->irq = irq;
- ret = alloc_subdevices(dev, 4);
+ ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;
|| (it->options[1] == 96)))
n_subdevices = 4; /* PCL-724 in 96 DIO configuration */
- ret = alloc_subdevices(dev, n_subdevices);
+ ret = comedi_alloc_subdevices(dev, n_subdevices);
if (ret < 0)
return ret;
dev->iobase = iobase;
dev->irq = 0;
- if (alloc_subdevices(dev, 2) < 0)
+ if (comedi_alloc_subdevices(dev, 2) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
printk("\n");
- ret = alloc_subdevices(dev, 3);
+ ret = comedi_alloc_subdevices(dev, 3);
if (ret < 0)
return ret;
dev->iobase = iobase;
dev->irq = 0;
- if (alloc_subdevices(dev, 4) < 0)
+ if (comedi_alloc_subdevices(dev, 4) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
if (board->n_dochan > 0)
n_subdevices++;
- ret = alloc_subdevices(dev, n_subdevices);
+ ret = comedi_alloc_subdevices(dev, n_subdevices);
if (ret < 0) {
free_resources(dev);
return ret;
subdevs[3] = COMEDI_SUBD_DO;
*/
- ret = alloc_subdevices(dev, 1);
+ ret = comedi_alloc_subdevices(dev, 1);
if (ret < 0)
return ret;
no_dma:
- ret = alloc_subdevices(dev, 4);
+ ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;
n_subdevices = board->numofports;
- ret = alloc_subdevices(dev, n_subdevices);
+ ret = comedi_alloc_subdevices(dev, n_subdevices);
if (ret < 0)
return ret;
dev->iobase = dev->iobase;
dev->irq = 0;
- if (alloc_subdevices(dev, 6) < 0)
+ if (comedi_alloc_subdevices(dev, 6) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
printk(KERN_CONT "\n");
dev->iobase = iobase;
- ret = alloc_subdevices(dev, 1);
+ ret = comedi_alloc_subdevices(dev, 1);
if (ret < 0)
return ret;
* Allocate 2 subdevs (32 + 16 DIO lines) or 3 32 DIO subdevs for the
* 96-channel version of the board.
*/
- if (alloc_subdevices(dev, 1) < 0) {
+ if (comedi_alloc_subdevices(dev, 1) < 0) {
printk(KERN_ERR "cannot allocate subdevice data structures\n");
return -ENOMEM;
}
*
* Allocate 1 AI + 1 AO + 2 DIO subdevs (24 lines per DIO)
*/
- if (alloc_subdevices(dev, n_subdevs) < 0) {
+ if (comedi_alloc_subdevices(dev, n_subdevs) < 0) {
printk(KERN_ERR "comedi%d: cannot allocate subdevice data structures\n",
dev->minor);
return -ENOMEM;
* Allocate 2 subdevs (32 + 16 DIO lines) or 3 32 DIO subdevs for the
* 96-channel version of the board.
*/
- if (alloc_subdevices(dev, n_subdevs) < 0) {
+ if (comedi_alloc_subdevices(dev, n_subdevs) < 0) {
dev_dbg(dev->hw_dev, "cannot allocate subdevice data structures\n");
return -ENOMEM;
}
}
dev->iobase = iobase;
- if (alloc_subdevices(dev, 1) < 0)
+ if (comedi_alloc_subdevices(dev, 1) < 0)
return -ENOMEM;
if (alloc_private(dev, sizeof(unsigned int) * board->n_chan) < 0)
return -ENOMEM;
dev->iobase = local->link->resource[0]->start;
- ret = alloc_subdevices(dev, 4);
+ ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;
* Allocate the subdevice structures. alloc_subdevice() is a
* convenient macro defined in comedidev.h.
*/
- if (alloc_subdevices(dev, 4) < 0)
+ if (comedi_alloc_subdevices(dev, 4) < 0)
return -ENOMEM;
dev->board_name = board->name;
- ret = alloc_subdevices(dev, 4);
+ ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;
dev->board_name = "rti802";
- if (alloc_subdevices(dev, 1) < 0
+ if (comedi_alloc_subdevices(dev, 1) < 0
|| alloc_private(dev, sizeof(struct rti802_private))) {
return -ENOMEM;
}
* convenient macro defined in comedidev.h.
*/
dev->n_subdevices = 4;
- if (alloc_subdevices(dev, dev->n_subdevices) < 0)
+ if (comedi_alloc_subdevices(dev, dev->n_subdevices) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
dev->board_ptr = s626_boards;
dev->board_name = thisboard->name;
- if (alloc_subdevices(dev, 6) < 0)
+ if (comedi_alloc_subdevices(dev, 6) < 0)
return -ENOMEM;
dev->iobase = (unsigned long)devpriv->base_addr;
dev_dbg(dev->hw_dev, "/dev/ttyS%d @ %d\n", devpriv->port,
devpriv->speed);
- if (alloc_subdevices(dev, 5) < 0)
+ if (comedi_alloc_subdevices(dev, 5) < 0)
return -ENOMEM;
/* digital input subdevice */
* Allocate the subdevice structures. alloc_subdevice() is a
* convenient macro defined in comedidev.h.
*/
- if (alloc_subdevices(dev, 3) < 0)
+ if (comedi_alloc_subdevices(dev, 3) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
/* Allocate the subdevice structures. alloc_subdevice() is a */
/* convenient macro defined in comedidev.h. */
- if (alloc_subdevices(dev, 1) < 0)
+ if (comedi_alloc_subdevices(dev, 1) < 0)
return -ENOMEM;
s = dev->subdevices + 0;
return -1;
}
- if (alloc_subdevices(dev, n_subd) < 0) {
+ if (comedi_alloc_subdevices(dev, n_subd) < 0) {
printk(KERN_ERR "out of memory\n");
return -ENOMEM;
}
}
/* allocate space for the subdevices */
- ret = alloc_subdevices(dev, dev->n_subdevices);
+ ret = comedi_alloc_subdevices(dev, dev->n_subdevices);
if (ret < 0) {
dev_err(&udev->interface->dev,
"comedi%d: error alloc space for subdev\n", dev->minor);
dev->n_subdevices = N_SUBDEVICES;
/* allocate space for the subdevices */
- ret = alloc_subdevices(dev, N_SUBDEVICES);
+ ret = comedi_alloc_subdevices(dev, N_SUBDEVICES);
if (ret < 0) {
printk(KERN_ERR "comedi%d: usbduxfast: error alloc space for "
"subdev\n", dev->minor);
}
/* allocate space for the subdevices */
- ret = alloc_subdevices(dev, dev->n_subdevices);
+ ret = comedi_alloc_subdevices(dev, dev->n_subdevices);
if (ret < 0) {
dev_err(&udev->interface->dev,
"comedi%d: no space for subdev\n", dev->minor);
else
n_subd = 6;
- if (alloc_subdevices(cdev, n_subd) < 0) {
+ if (comedi_alloc_subdevices(cdev, n_subd) < 0) {
up(&dev->limit_sem);
mutex_unlock(&glb_mutex);
return -ENOMEM;