staging: comedi: ni_mio_cs: cleanup cs_attach()
authorH Hartley Sweeten <hartleys@visionengravers.com>
Sat, 26 Jan 2013 00:34:27 +0000 (17:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Jan 2013 04:08:23 +0000 (23:08 -0500)
Absorb the code from mio_cs_config() into this function and
properly return the error if the configuration fails.

Remove the DPRINTK() function trace message.

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/ni_mio_cs.c

index e0adf23bd527da23119536cbc5fc4dd6ad475e0a..84f4378046691e57bb2a5b7e090a4708c4933221 100644 (file)
@@ -350,32 +350,24 @@ static int mio_pcmcia_config_loop(struct pcmcia_device *p_dev, void *priv_data)
        return -ENODEV;
 }
 
-static void mio_cs_config(struct pcmcia_device *link)
+static int cs_attach(struct pcmcia_device *link)
 {
        int ret;
 
-       DPRINTK("mio_cs_config(link=%p)\n", link);
+       cur_dev = link;
+
        link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
 
        ret = pcmcia_loop_config(link, mio_pcmcia_config_loop, NULL);
        if (ret) {
                dev_warn(&link->dev, "no configuration found\n");
-               return;
+               return ret;
        }
 
        if (!link->irq)
                dev_info(&link->dev, "no IRQ available\n");
 
-       ret = pcmcia_enable_device(link);
-}
-
-static int cs_attach(struct pcmcia_device *link)
-{
-       cur_dev = link;
-
-       mio_cs_config(link);
-
-       return 0;
+       return pcmcia_enable_device(link);
 }
 
 static void cs_detach(struct pcmcia_device *link)
This page took 0.027014 seconds and 5 git commands to generate.