staging: comedi: quatech_daqp_cs: remove forward declarations
authorH Hartley Sweeten <hartleys@visionengravers.com>
Fri, 25 Jan 2013 21:59:17 +0000 (14:59 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Jan 2013 04:06:40 +0000 (23:06 -0500)
Move some of the functions to remove the need for the forward
declarations.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/quatech_daqp_cs.c

index c4a03eb4c84abdb86e950f6442b88f09bc63c362..748aa6a7a88a5fb26af0d21102f6770250c6c781 100644 (file)
@@ -180,19 +180,6 @@ static const struct comedi_lrange range_daqp_ai = { 4, {
 
 static const struct comedi_lrange range_daqp_ao = { 1, {BIP_RANGE(5)} };
 
-/*====================================================================*/
-
-/* comedi interface code */
-
-static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it);
-static void daqp_detach(struct comedi_device *dev);
-static struct comedi_driver driver_daqp = {
-       .driver_name = "quatech_daqp_cs",
-       .module = THIS_MODULE,
-       .attach = daqp_attach,
-       .detach = daqp_detach,
-};
-
 #ifdef DAQP_DEBUG
 
 static void daqp_dump(struct comedi_device *dev)
@@ -889,6 +876,13 @@ static void daqp_detach(struct comedi_device *dev)
        /* Nothing to cleanup */
 }
 
+static struct comedi_driver driver_daqp = {
+       .driver_name    = "quatech_daqp_cs",
+       .module         = THIS_MODULE,
+       .attach         = daqp_attach,
+       .detach         = daqp_detach,
+};
+
 /*====================================================================
 
     PCMCIA interface code
@@ -924,55 +918,29 @@ static void daqp_detach(struct comedi_device *dev)
 
 ======================================================================*/
 
-static void daqp_cs_config(struct pcmcia_device *link);
-static void daqp_cs_release(struct pcmcia_device *link);
-static int daqp_cs_suspend(struct pcmcia_device *p_dev);
-static int daqp_cs_resume(struct pcmcia_device *p_dev);
-
-static int daqp_cs_attach(struct pcmcia_device *);
-static void daqp_cs_detach(struct pcmcia_device *);
-
-static int daqp_cs_attach(struct pcmcia_device *link)
+static int daqp_cs_suspend(struct pcmcia_device *link)
 {
-       struct local_info_t *local;
-       int i;
-
-       dev_dbg(&link->dev, "daqp_cs_attach()\n");
-
-       for (i = 0; i < MAX_DEV; i++)
-               if (dev_table[i] == NULL)
-                       break;
-       if (i == MAX_DEV) {
-               dev_notice(&link->dev, "no devices available\n");
-               return -ENODEV;
-       }
+       struct local_info_t *local = link->priv;
 
-       /* Allocate space for private device-specific data */
-       local = kzalloc(sizeof(struct local_info_t), GFP_KERNEL);
-       if (!local)
-               return -ENOMEM;
+       /* Mark the device as stopped, to block IO until later */
+       local->stop = 1;
+       return 0;
+}
 
-       local->table_index = i;
-       dev_table[i] = local;
-       local->link = link;
-       link->priv = local;
+static int daqp_cs_resume(struct pcmcia_device *link)
+{
+       struct local_info_t *local = link->priv;
 
-       daqp_cs_config(link);
+       local->stop = 0;
 
        return 0;
-}                              /* daqp_cs_attach */
+}
 
-static void daqp_cs_detach(struct pcmcia_device *link)
+static void daqp_cs_release(struct pcmcia_device *link)
 {
-       struct local_info_t *dev = link->priv;
-
-       dev->stop = 1;
-       daqp_cs_release(link);
-
-       /* Unlink device structure, and free it */
-       dev_table[dev->table_index] = NULL;
-       kfree(dev);
+       dev_dbg(&link->dev, "daqp_cs_release\n");
 
+       pcmcia_disable_device(link);
 }
 
 static int daqp_pcmcia_config_loop(struct pcmcia_device *p_dev, void *priv_data)
@@ -1009,32 +977,48 @@ static void daqp_cs_config(struct pcmcia_device *link)
 
 failed:
        daqp_cs_release(link);
+}
 
-}                              /* daqp_cs_config */
-
-static void daqp_cs_release(struct pcmcia_device *link)
+static int daqp_cs_attach(struct pcmcia_device *link)
 {
-       dev_dbg(&link->dev, "daqp_cs_release\n");
+       struct local_info_t *local;
+       int i;
 
-       pcmcia_disable_device(link);
-}                              /* daqp_cs_release */
+       dev_dbg(&link->dev, "daqp_cs_attach()\n");
 
-static int daqp_cs_suspend(struct pcmcia_device *link)
-{
-       struct local_info_t *local = link->priv;
+       for (i = 0; i < MAX_DEV; i++)
+               if (dev_table[i] == NULL)
+                       break;
+       if (i == MAX_DEV) {
+               dev_notice(&link->dev, "no devices available\n");
+               return -ENODEV;
+       }
+
+       /* Allocate space for private device-specific data */
+       local = kzalloc(sizeof(struct local_info_t), GFP_KERNEL);
+       if (!local)
+               return -ENOMEM;
+
+       local->table_index = i;
+       dev_table[i] = local;
+       local->link = link;
+       link->priv = local;
+
+       daqp_cs_config(link);
 
-       /* Mark the device as stopped, to block IO until later */
-       local->stop = 1;
        return 0;
 }
 
-static int daqp_cs_resume(struct pcmcia_device *link)
+static void daqp_cs_detach(struct pcmcia_device *link)
 {
-       struct local_info_t *local = link->priv;
+       struct local_info_t *dev = link->priv;
 
-       local->stop = 0;
+       dev->stop = 1;
+       daqp_cs_release(link);
 
-       return 0;
+       /* Unlink device structure, and free it */
+       dev_table[dev->table_index] = NULL;
+       kfree(dev);
 }
 
 /*====================================================================*/