Commit e5e7ff89 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: ni_mio_cs: cleanup cs_attach()

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1b69a757
...@@ -350,32 +350,24 @@ static int mio_pcmcia_config_loop(struct pcmcia_device *p_dev, void *priv_data) ...@@ -350,32 +350,24 @@ static int mio_pcmcia_config_loop(struct pcmcia_device *p_dev, void *priv_data)
return -ENODEV; return -ENODEV;
} }
static void mio_cs_config(struct pcmcia_device *link) static int cs_attach(struct pcmcia_device *link)
{ {
int ret; int ret;
DPRINTK("mio_cs_config(link=%p)\n", link); cur_dev = link;
link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
ret = pcmcia_loop_config(link, mio_pcmcia_config_loop, NULL); ret = pcmcia_loop_config(link, mio_pcmcia_config_loop, NULL);
if (ret) { if (ret) {
dev_warn(&link->dev, "no configuration found\n"); dev_warn(&link->dev, "no configuration found\n");
return; return ret;
} }
if (!link->irq) if (!link->irq)
dev_info(&link->dev, "no IRQ available\n"); dev_info(&link->dev, "no IRQ available\n");
ret = pcmcia_enable_device(link); return pcmcia_enable_device(link);
}
static int cs_attach(struct pcmcia_device *link)
{
cur_dev = link;
mio_cs_config(link);
return 0;
} }
static void cs_detach(struct pcmcia_device *link) static void cs_detach(struct pcmcia_device *link)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment