From: H Hartley Sweeten Date: Fri, 20 Jun 2014 18:10:20 +0000 (-0700) Subject: staging: comedi: ni_pcimio: remove forward declarations X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a55e9067f3b08ef58764ef505a4d0a4fc754ba07;p=linux-beck.git staging: comedi: ni_pcimio: remove forward declarations Move some functions to avoid the need for the forward declarations. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c index 177947c09117..faa7eb7f1d97 100644 --- a/drivers/staging/comedi/drivers/ni_pcimio.c +++ b/drivers/staging/comedi/drivers/ni_pcimio.c @@ -1050,18 +1050,75 @@ static const struct ni_board_struct ni_boards[] = { #include "ni_mio_common.c" static int pcimio_ai_change(struct comedi_device *dev, - struct comedi_subdevice *s, unsigned long new_size); + struct comedi_subdevice *s, + unsigned long new_size) +{ + struct ni_private *devpriv = dev->private; + int ret; + + ret = mite_buf_change(devpriv->ai_mite_ring, s); + if (ret < 0) + return ret; + + return 0; +} + static int pcimio_ao_change(struct comedi_device *dev, - struct comedi_subdevice *s, unsigned long new_size); + struct comedi_subdevice *s, + unsigned long new_size) +{ + struct ni_private *devpriv = dev->private; + int ret; + + ret = mite_buf_change(devpriv->ao_mite_ring, s); + if (ret < 0) + return ret; + + return 0; +} + static int pcimio_gpct0_change(struct comedi_device *dev, struct comedi_subdevice *s, - unsigned long new_size); + unsigned long new_size) +{ + struct ni_private *devpriv = dev->private; + int ret; + + ret = mite_buf_change(devpriv->gpct_mite_ring[0], s); + if (ret < 0) + return ret; + + return 0; +} + static int pcimio_gpct1_change(struct comedi_device *dev, struct comedi_subdevice *s, - unsigned long new_size); + unsigned long new_size) +{ + struct ni_private *devpriv = dev->private; + int ret; + + ret = mite_buf_change(devpriv->gpct_mite_ring[1], s); + if (ret < 0) + return ret; + + return 0; +} + static int pcimio_dio_change(struct comedi_device *dev, struct comedi_subdevice *s, - unsigned long new_size); + unsigned long new_size) +{ + struct ni_private *devpriv = dev->private; + int ret; + + ret = mite_buf_change(devpriv->cdo_mite_ring, s); + if (ret < 0) + return ret; + + return 0; +} + static void m_series_init_eeprom_buffer(struct comedi_device *dev) { @@ -1230,73 +1287,6 @@ static int pcimio_auto_attach(struct comedi_device *dev, return 0; } -static int pcimio_ai_change(struct comedi_device *dev, - struct comedi_subdevice *s, unsigned long new_size) -{ - struct ni_private *devpriv = dev->private; - int ret; - - ret = mite_buf_change(devpriv->ai_mite_ring, s); - if (ret < 0) - return ret; - - return 0; -} - -static int pcimio_ao_change(struct comedi_device *dev, - struct comedi_subdevice *s, unsigned long new_size) -{ - struct ni_private *devpriv = dev->private; - int ret; - - ret = mite_buf_change(devpriv->ao_mite_ring, s); - if (ret < 0) - return ret; - - return 0; -} - -static int pcimio_gpct0_change(struct comedi_device *dev, - struct comedi_subdevice *s, - unsigned long new_size) -{ - struct ni_private *devpriv = dev->private; - int ret; - - ret = mite_buf_change(devpriv->gpct_mite_ring[0], s); - if (ret < 0) - return ret; - - return 0; -} - -static int pcimio_gpct1_change(struct comedi_device *dev, - struct comedi_subdevice *s, - unsigned long new_size) -{ - struct ni_private *devpriv = dev->private; - int ret; - - ret = mite_buf_change(devpriv->gpct_mite_ring[1], s); - if (ret < 0) - return ret; - - return 0; -} - -static int pcimio_dio_change(struct comedi_device *dev, - struct comedi_subdevice *s, unsigned long new_size) -{ - struct ni_private *devpriv = dev->private; - int ret; - - ret = mite_buf_change(devpriv->cdo_mite_ring, s); - if (ret < 0) - return ret; - - return 0; -} - static struct comedi_driver ni_pcimio_driver = { .driver_name = "ni_pcimio", .module = THIS_MODULE,