diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2012-06-12 00:45:15 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-12 18:14:33 (GMT) |
commit | 2f0b9d082e5d0056a3aca4be038483a564849196 (patch) | |
tree | 2353f9704467790c9dcc40537892fd4e6a363288 /drivers/staging/comedi/comedidev.h | |
parent | e34995148a2a305106c4f746fb76da23488c46c7 (diff) | |
download | linux-fsl-qoriq-2f0b9d082e5d0056a3aca4be038483a564849196.tar.xz |
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>
Diffstat (limited to 'drivers/staging/comedi/comedidev.h')
-rw-r--r-- | drivers/staging/comedi/comedidev.h | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h index 9cd2b51..bb98f82 100644 --- a/drivers/staging/comedi/comedidev.h +++ b/drivers/staging/comedi/comedidev.h @@ -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); |