staging: comedi: export alloc_subdevices as comedi_alloc_subdevices

Move the inline alloc_subdevices() function from comedidev.h
to drivers.c and rename it to comedi_alloc_subdevices(). The
function is large enough to warrant being an exported symbol
rather than being an inline in every driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
H Hartley Sweeten 2012-06-11 17:45:15 -07:00 committed by Greg Kroah-Hartman
parent e34995148a
commit 2f0b9d082e
105 changed files with 127 additions and 123 deletions

View File

@ -292,6 +292,8 @@ static inline struct comedi_subdevice *comedi_get_write_subdevice(
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);
@ -413,26 +415,6 @@ struct comedi_lrange {
/* 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);

View File

@ -56,6 +56,27 @@ static int poll_invalid(struct comedi_device *dev, struct comedi_subdevice *s);
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;

View File

@ -388,7 +388,7 @@ static int dev_8255_attach(struct comedi_device *dev,
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 */

View File

@ -82,7 +82,7 @@ static int acl7225b_attach(struct comedi_device *dev,
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;

View File

@ -1688,7 +1688,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
} 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;

View File

@ -63,7 +63,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
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;

View File

@ -301,7 +301,7 @@ static int pci6208_attach(struct comedi_device *dev,
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;

View File

@ -116,7 +116,7 @@ static int adl_pci7230_attach(struct comedi_device *dev,
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);

View File

@ -92,7 +92,7 @@ static int adl_pci7296_attach(struct comedi_device *dev,
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);

View File

@ -125,7 +125,7 @@ static int adl_pci7432_attach(struct comedi_device *dev,
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);

View File

@ -261,7 +261,7 @@ static int adl_pci8164_attach(struct comedi_device *dev,
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);

View File

@ -1317,7 +1317,7 @@ static int pci9111_attach(struct comedi_device *dev,
/* 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;

View File

@ -2268,7 +2268,7 @@ static int pci9118_attach(struct comedi_device *dev,
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;

View File

@ -271,7 +271,7 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
* 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;

View File

@ -1433,7 +1433,7 @@ static int pci1710_attach(struct comedi_device *dev,
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;

View File

@ -365,7 +365,7 @@ static int pci1723_attach(struct comedi_device *dev,
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;

View File

@ -1156,7 +1156,7 @@ static int pci_dio_attach(struct comedi_device *dev,
n_subdevices++;
}
ret = alloc_subdevices(dev, n_subdevices);
ret = comedi_alloc_subdevices(dev, n_subdevices);
if (ret < 0)
return ret;

View File

@ -182,7 +182,7 @@ static int aio_aio12_8_attach(struct comedi_device *dev,
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];

View File

@ -124,7 +124,7 @@ static int aio_iiro_16_attach(struct comedi_device *dev,
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;

View File

@ -1273,7 +1273,7 @@ static int dio200_common_attach(struct comedi_device *dev, unsigned long iobase,
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;

View File

@ -455,7 +455,7 @@ static int pc236_common_attach(struct comedi_device *dev, unsigned long iobase,
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;

View File

@ -227,7 +227,7 @@ static int pc263_common_attach(struct comedi_device *dev, unsigned long iobase)
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;

View File

@ -1380,7 +1380,7 @@ static int pci224_attach_common(struct comedi_device *dev,
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;

View File

@ -2843,7 +2843,7 @@ static int pci230_attach_common(struct comedi_device *dev,
* 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 */

View File

@ -433,7 +433,8 @@ static int c6xdigio_attach(struct comedi_device *dev,
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;

View File

@ -195,7 +195,7 @@ static int das16cs_attach(struct comedi_device *dev,
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;

View File

@ -617,7 +617,7 @@ static int cb_pcidas_attach(struct comedi_device *dev,
/*
* Allocate the subdevice structures.
*/
if (alloc_subdevices(dev, 7) < 0)
if (comedi_alloc_subdevices(dev, 7) < 0)
return -ENOMEM;
s = dev->subdevices + 0;

View File

@ -1345,7 +1345,7 @@ static int setup_subdevices(struct comedi_device *dev)
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;

View File

@ -336,7 +336,7 @@ static int cb_pcidda_attach(struct comedi_device *dev,
/*
* Allocate the subdevice structures.
*/
if (alloc_subdevices(dev, 3) < 0)
if (comedi_alloc_subdevices(dev, 3) < 0)
return -ENOMEM;
s = dev->subdevices + 0;

View File

@ -181,7 +181,7 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
* 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++) {

View File

@ -273,7 +273,7 @@ static int cb_pcimdas_attach(struct comedi_device *dev,
* 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;

View File

@ -240,7 +240,7 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
* 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;

View File

@ -362,7 +362,7 @@ static int bonding_attach(struct comedi_device *dev,
* 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;

View File

@ -315,7 +315,7 @@ static int parport_attach(struct comedi_device *dev,
}
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));

View File

@ -448,7 +448,7 @@ static int waveform_attach(struct comedi_device *dev,
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;

View File

@ -115,7 +115,7 @@ static int contec_attach(struct comedi_device *dev, struct comedi_devconfig *it)
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) {

View File

@ -772,7 +772,7 @@ static int daqboard2000_attach(struct comedi_device *dev,
if (!devpriv->plx || !devpriv->daq)
return -ENOMEM;
result = alloc_subdevices(dev, 3);
result = comedi_alloc_subdevices(dev, 3);
if (result < 0)
goto out;

View File

@ -834,7 +834,7 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase)
dev->board_name = thisboard->name;
ret = alloc_subdevices(dev, 6);
ret = comedi_alloc_subdevices(dev, 6);
if (ret < 0)
return ret;

View File

@ -1264,7 +1264,7 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
}
devpriv->timer_mode = timer_mode ? 1 : 0;
ret = alloc_subdevices(dev, 5);
ret = comedi_alloc_subdevices(dev, 5);
if (ret < 0)
return ret;

View File

@ -646,7 +646,7 @@ static int das16m1_attach(struct comedi_device *dev,
return -EINVAL;
}
ret = alloc_subdevices(dev, 4);
ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;

View File

@ -1644,7 +1644,7 @@ static int das1800_attach(struct comedi_device *dev,
return -ENOMEM;
}
if (alloc_subdevices(dev, 4) < 0)
if (comedi_alloc_subdevices(dev, 4) < 0)
return -ENOMEM;
/* analog input subdevice */

View File

@ -307,7 +307,7 @@ static int das6402_attach(struct comedi_device *dev,
if (ret < 0)
return ret;
ret = alloc_subdevices(dev, 1);
ret = comedi_alloc_subdevices(dev, 1);
if (ret < 0)
return ret;

View File

@ -510,7 +510,7 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dev->board_name = thisboard->name;
if (alloc_subdevices(dev, 3) < 0)
if (comedi_alloc_subdevices(dev, 3) < 0)
return -ENOMEM;
/* analog input subdevice */

View File

@ -375,7 +375,7 @@ static int dmm32at_attach(struct comedi_device *dev,
* 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;

View File

@ -628,7 +628,7 @@ static int dt2801_attach(struct comedi_device *dev, struct comedi_devconfig *it)
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;

View File

@ -465,7 +465,7 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it)
}
#endif
ret = alloc_subdevices(dev, 4);
ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;

View File

@ -338,7 +338,7 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it)
#endif
}
ret = alloc_subdevices(dev, 1);
ret = comedi_alloc_subdevices(dev, 1);
if (ret < 0)
return ret;

View File

@ -177,7 +177,7 @@ static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it)
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;

View File

@ -137,7 +137,7 @@ static int dt2817_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dev->iobase = iobase;
dev->board_name = "dt2817";
ret = alloc_subdevices(dev, 1);
ret = comedi_alloc_subdevices(dev, 1);
if (ret < 0)
return ret;

View File

@ -1268,7 +1268,7 @@ static int dt282x_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (ret < 0)
return ret;
ret = alloc_subdevices(dev, 3);
ret = comedi_alloc_subdevices(dev, 3);
if (ret < 0)
return ret;

View File

@ -882,7 +882,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
}
dev->irq = devpriv->pci_dev->irq;
ret = alloc_subdevices(dev, 4);
ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;

View File

@ -1036,7 +1036,7 @@ static int dt9812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
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 */

View File

@ -329,7 +329,7 @@ static int dyna_pci10xx_attach(struct comedi_device *dev,
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);

View File

@ -131,7 +131,7 @@ static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it)
printk(KERN_DEBUG "malloc ok\n");
#endif
if (alloc_subdevices(dev, 2) < 0)
if (comedi_alloc_subdevices(dev, 2) < 0)
return -ENOMEM;
/*

View File

@ -431,7 +431,7 @@ static int setup_subdevices(struct comedi_device *dev)
{
struct comedi_subdevice *s;
if (alloc_subdevices(dev, 1) < 0)
if (comedi_alloc_subdevices(dev, 1) < 0)
return -ENOMEM;
s = dev->subdevices + 0;

View File

@ -903,7 +903,7 @@ static int icp_multi_attach(struct comedi_device *dev,
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;

View File

@ -202,7 +202,7 @@ static int pci20xxx_attach(struct comedi_device *dev,
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;

View File

@ -826,7 +826,7 @@ static int jr3_pci_attach(struct comedi_device *dev,
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;

View File

@ -190,7 +190,7 @@ static int cnt_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dev->iobase = io_base;
/* allocate the subdevice structures */
error = alloc_subdevices(dev, 1);
error = comedi_alloc_subdevices(dev, 1);
if (error < 0)
return error;

View File

@ -2195,7 +2195,7 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
* 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;
/*=========================================================================

View File

@ -762,7 +762,7 @@ static int me_attach(struct comedi_device *dev, struct comedi_devconfig *it)
me_reset(dev);
/* device driver capabilities */
error = alloc_subdevices(dev, 3);
error = comedi_alloc_subdevices(dev, 3);
if (error < 0)
return error;

View File

@ -349,7 +349,7 @@ static int mpc624_attach(struct comedi_device *dev, struct comedi_devconfig *it)
}
/* Subdevices structures */
if (alloc_subdevices(dev, 1) < 0)
if (comedi_alloc_subdevices(dev, 1) < 0)
return -ENOMEM;
s = dev->subdevices + 0;

View File

@ -131,7 +131,7 @@ static int mpc8260cpm_attach(struct comedi_device *dev,
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++) {

View File

@ -255,7 +255,7 @@ static int multiq3_attach(struct comedi_device *dev,
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;

View File

@ -397,7 +397,7 @@ static int ni6527_attach(struct comedi_device *dev, struct comedi_devconfig *it)
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;

View File

@ -678,7 +678,7 @@ static int ni_65xx_attach(struct comedi_device *dev,
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;

View File

@ -1095,7 +1095,7 @@ static int ni_660x_attach(struct comedi_device *dev,
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;

View File

@ -202,7 +202,7 @@ static int ni_670x_attach(struct comedi_device *dev,
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;

View File

@ -826,7 +826,7 @@ static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it)
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 */

View File

@ -356,7 +356,7 @@ static int atao_attach(struct comedi_device *dev, struct comedi_devconfig *it)
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;

View File

@ -709,7 +709,7 @@ static int atmio16d_attach(struct comedi_device *dev,
dev->board_name = board->name;
ret = alloc_subdevices(dev, 4);
ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;

View File

@ -409,7 +409,7 @@ static int dio700_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dev->board_name = thisboard->name;
if (alloc_subdevices(dev, 1) < 0)
if (comedi_alloc_subdevices(dev, 1) < 0)
return -ENOMEM;
/* DAQCard-700 dio */

View File

@ -158,7 +158,7 @@ static int dio24_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dev->board_name = thisboard->name;
if (alloc_subdevices(dev, 1) < 0)
if (comedi_alloc_subdevices(dev, 1) < 0)
return -ENOMEM;
/* 8255 dio */

View File

@ -622,7 +622,7 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase,
dev->board_name = thisboard->name;
if (alloc_subdevices(dev, 5) < 0)
if (comedi_alloc_subdevices(dev, 5) < 0)
return -ENOMEM;
/* analog input subdevice */

View File

@ -4412,7 +4412,7 @@ static int ni_E_init(struct comedi_device *dev, struct comedi_devconfig *it)
return -EINVAL;
}
if (alloc_subdevices(dev, NI_NUM_SUBDEVICES) < 0)
if (comedi_alloc_subdevices(dev, NI_NUM_SUBDEVICES) < 0)
return -ENOMEM;
/* analog input subdevice */

View File

@ -1248,7 +1248,7 @@ static int nidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
else
n_subdevices = 1;
ret = alloc_subdevices(dev, n_subdevices);
ret = comedi_alloc_subdevices(dev, n_subdevices);
if (ret < 0)
return ret;

View File

@ -518,7 +518,7 @@ static int pcl711_attach(struct comedi_device *dev, struct comedi_devconfig *it)
}
dev->irq = irq;
ret = alloc_subdevices(dev, 4);
ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;

View File

@ -156,7 +156,7 @@ static int pcl724_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|| (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;

View File

@ -63,7 +63,7 @@ static int pcl725_attach(struct comedi_device *dev, struct comedi_devconfig *it)
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;

View File

@ -292,7 +292,7 @@ static int pcl726_attach(struct comedi_device *dev, struct comedi_devconfig *it)
printk("\n");
ret = alloc_subdevices(dev, 3);
ret = comedi_alloc_subdevices(dev, 3);
if (ret < 0)
return ret;

View File

@ -85,7 +85,7 @@ static int pcl730_attach(struct comedi_device *dev, struct comedi_devconfig *it)
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;

View File

@ -1382,7 +1382,7 @@ static int pcl812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
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;

View File

@ -1194,7 +1194,7 @@ static int pcl816_attach(struct comedi_device *dev, struct comedi_devconfig *it)
subdevs[3] = COMEDI_SUBD_DO;
*/
ret = alloc_subdevices(dev, 1);
ret = comedi_alloc_subdevices(dev, 1);
if (ret < 0)
return ret;

View File

@ -1778,7 +1778,7 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
no_dma:
ret = alloc_subdevices(dev, 4);
ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;

View File

@ -258,7 +258,7 @@ static int pcm3724_attach(struct comedi_device *dev,
n_subdevices = board->numofports;
ret = alloc_subdevices(dev, n_subdevices);
ret = comedi_alloc_subdevices(dev, n_subdevices);
if (ret < 0)
return ret;

View File

@ -71,7 +71,7 @@ static int pcm3730_attach(struct comedi_device *dev,
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;

View File

@ -117,7 +117,7 @@ static int pcmad_attach(struct comedi_device *dev, struct comedi_devconfig *it)
printk(KERN_CONT "\n");
dev->iobase = iobase;
ret = alloc_subdevices(dev, 1);
ret = comedi_alloc_subdevices(dev, 1);
if (ret < 0)
return ret;

View File

@ -197,7 +197,7 @@ static int pcmda12_attach(struct comedi_device *dev,
* 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;
}

View File

@ -1077,7 +1077,7 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
*
* 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;

View File

@ -807,7 +807,7 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
* 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;
}

View File

@ -160,7 +160,7 @@ static int poc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
}
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;

View File

@ -871,7 +871,7 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dev->iobase = local->link->resource[0]->start;
ret = alloc_subdevices(dev, 4);
ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;

View File

@ -2003,7 +2003,7 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it)
* 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;

View File

@ -348,7 +348,7 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dev->board_name = board->name;
ret = alloc_subdevices(dev, 4);
ret = comedi_alloc_subdevices(dev, 4);
if (ret < 0)
return ret;

View File

@ -103,7 +103,7 @@ static int rti802_attach(struct comedi_device *dev, struct comedi_devconfig *it)
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;
}

View File

@ -779,7 +779,7 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it)
* 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;

View File

@ -595,7 +595,7 @@ static int s626_attach(struct comedi_device *dev, struct comedi_devconfig *it)
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;

View File

@ -792,7 +792,7 @@ static int serial2002_attach(struct comedi_device *dev,
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 */

View File

@ -237,7 +237,7 @@ static int skel_attach(struct comedi_device *dev, struct comedi_devconfig *it)
* 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;

View File

@ -200,7 +200,7 @@ static int dnp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
/* 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;

Some files were not shown because too many files have changed in this diff Show More