summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorH Hartley Sweeten2013-01-26 02:36:33 +0100
committerGreg Kroah-Hartman2013-01-30 05:09:25 +0100
commit00cefaa56219ac78fa6ece610b0854628a9724aa (patch)
treee232fef0d99ae7c46d777b0835eefd8e18f4666b /drivers/staging/comedi
parentstaging: comedi: ni_labpc_cs: remove pcmcia_driver suspend/resume (diff)
downloadkernel-qcow2-linux-00cefaa56219ac78fa6ece610b0854628a9724aa.tar.gz
kernel-qcow2-linux-00cefaa56219ac78fa6ece610b0854628a9724aa.tar.xz
kernel-qcow2-linux-00cefaa56219ac78fa6ece610b0854628a9724aa.zip
staging: comedi: ni_labpc_cs: move pcmcia_driver functions
For aesthetic reasons, move all the pcmcia_driver functions so they are near the pcmcia_driver declaration. This also removes the need for some of 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>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/drivers/ni_labpc_cs.c63
1 files changed, 28 insertions, 35 deletions
diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c
index 30b2dddb17b1..61ad5ce37a4e 100644
--- a/drivers/staging/comedi/drivers/ni_labpc_cs.c
+++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c
@@ -154,45 +154,11 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return labpc_common_attach(dev, iobase, irq, 0);
}
-static void labpc_config(struct pcmcia_device *link);
-
-static int labpc_cs_attach(struct pcmcia_device *);
-static void labpc_cs_detach(struct pcmcia_device *);
-
struct local_info_t {
struct pcmcia_device *link;
struct bus_operations *bus;
};
-static int labpc_cs_attach(struct pcmcia_device *link)
-{
- struct local_info_t *local;
-
- dev_dbg(&link->dev, "labpc_cs_attach()\n");
-
- /* Allocate space for private device-specific data */
- local = kzalloc(sizeof(struct local_info_t), GFP_KERNEL);
- if (!local)
- return -ENOMEM;
- local->link = link;
- link->priv = local;
-
- pcmcia_cur_dev = link;
-
- labpc_config(link);
-
- return 0;
-} /* labpc_cs_attach */
-
-static void labpc_cs_detach(struct pcmcia_device *link)
-{
- pcmcia_disable_device(link);
-
- /* This points to the parent local_info_t struct (may be null) */
- kfree(link->priv);
-
-}
-
static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
void *priv_data)
{
@@ -202,7 +168,6 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
return pcmcia_request_io(p_dev);
}
-
static void labpc_config(struct pcmcia_device *link)
{
int ret;
@@ -231,6 +196,34 @@ failed:
pcmcia_disable_device(link);
}
+static int labpc_cs_attach(struct pcmcia_device *link)
+{
+ struct local_info_t *local;
+
+ dev_dbg(&link->dev, "labpc_cs_attach()\n");
+
+ /* Allocate space for private device-specific data */
+ local = kzalloc(sizeof(struct local_info_t), GFP_KERNEL);
+ if (!local)
+ return -ENOMEM;
+ local->link = link;
+ link->priv = local;
+
+ pcmcia_cur_dev = link;
+
+ labpc_config(link);
+
+ return 0;
+}
+
+static void labpc_cs_detach(struct pcmcia_device *link)
+{
+ pcmcia_disable_device(link);
+
+ /* This points to the parent local_info_t struct (may be null) */
+ kfree(link->priv);
+}
+
static const struct pcmcia_device_id labpc_cs_ids[] = {
/* N.B. These IDs should match those in labpc_cs_boards (ni_labpc.c) */
PCMCIA_DEVICE_MANF_CARD(0x010b, 0x0103), /* daqcard-1200 */