diff options
author | H Hartley Sweeten | 2013-01-26 02:36:50 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2013-01-30 05:09:25 +0100 |
commit | fdcb5fdee2c7ec6327d08f4529da7e1130d0fa63 (patch) | |
tree | f18657bcfb9fa8a11df468d47d8f8e967d70b98a /drivers/staging/comedi | |
parent | staging: comedi: ni_labpc_cs: move pcmcia_driver functions (diff) | |
download | kernel-qcow2-linux-fdcb5fdee2c7ec6327d08f4529da7e1130d0fa63.tar.gz kernel-qcow2-linux-fdcb5fdee2c7ec6327d08f4529da7e1130d0fa63.tar.xz kernel-qcow2-linux-fdcb5fdee2c7ec6327d08f4529da7e1130d0fa63.zip |
staging: comedi: ni_labpc_cs: cleanup labpc_cs_attach()
Absorb the code from labpc_config() into this function and properly
return the error if the configuration fails.
Also, remove the dev_dbg() 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>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/drivers/ni_labpc_cs.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c index 61ad5ce37a4e..e3ea13d84500 100644 --- a/drivers/staging/comedi/drivers/ni_labpc_cs.c +++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c @@ -168,11 +168,18 @@ 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) +static int labpc_cs_attach(struct pcmcia_device *link) { + struct local_info_t *local; int ret; - dev_dbg(&link->dev, "labpc_config\n"); + local = kzalloc(sizeof(*local), GFP_KERNEL); + if (!local) + return -ENOMEM; + local->link = link; + link->priv = local; + + pcmcia_cur_dev = link; link->config_flags |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ | CONF_AUTO_AUDIO | CONF_AUTO_SET_IO; @@ -190,30 +197,11 @@ static void labpc_config(struct pcmcia_device *link) if (ret) goto failed; - return; + return 0; 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; + return ret; } static void labpc_cs_detach(struct pcmcia_device *link) |