From: H Hartley Sweeten Date: Sat, 26 Jan 2013 00:34:27 +0000 (-0700) Subject: staging: comedi: ni_mio_cs: cleanup cs_attach() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=e5e7ff89e660e8e1a0861062197f3fd4d7576c41;p=openwrt%2Fstaging%2Fblogic.git 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: H Hartley Sweeten Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/ni_mio_cs.c b/drivers/staging/comedi/drivers/ni_mio_cs.c index e0adf23bd527..84f437804669 100644 --- a/drivers/staging/comedi/drivers/ni_mio_cs.c +++ b/drivers/staging/comedi/drivers/ni_mio_cs.c @@ -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)