Skip to content

Commit

Permalink
staging: comedi: ni_mio_cs: cleanup cs_attach()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jan 30, 2013
1 parent 1b69a75 commit e5e7ff8
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions drivers/staging/comedi/drivers/ni_mio_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e5e7ff8

Please sign in to comment.