mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
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:
parent
e34995148a
commit
2f0b9d082e
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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];
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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++) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
/*
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
/*=========================================================================
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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++) {
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
@ -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
Loading…
Reference in New Issue
Block a user