summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorH Hartley Sweeten2013-01-26 02:37:06 +0100
committerGreg Kroah-Hartman2013-01-30 05:09:25 +0100
commitb2e1be03ac1747cbb758fa146fe5cf364f306420 (patch)
treec6f38ca0e67d9fa5ad70e0a0f53b3230515596d4 /drivers/staging/comedi
parentstaging: comedi: ni_labpc_cs: cleanup labpc_cs_attach() (diff)
downloadkernel-qcow2-linux-b2e1be03ac1747cbb758fa146fe5cf364f306420.tar.gz
kernel-qcow2-linux-b2e1be03ac1747cbb758fa146fe5cf364f306420.tar.xz
kernel-qcow2-linux-b2e1be03ac1747cbb758fa146fe5cf364f306420.zip
staging: comedi: ni_labpc_cs: remove pcmcia_device private data
The private data, struct local_info_t, is not being used in the driver. Remove it as well as the kzalloc/kfree. Also, don't set the 'pcmcia_cur_dev' variable unless the pcmcia configuration is successful. 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.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c
index e3ea13d84500..831411d50ebb 100644
--- a/drivers/staging/comedi/drivers/ni_labpc_cs.c
+++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c
@@ -154,11 +154,6 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return labpc_common_attach(dev, iobase, irq, 0);
}
-struct local_info_t {
- struct pcmcia_device *link;
- struct bus_operations *bus;
-};
-
static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
void *priv_data)
{
@@ -170,17 +165,8 @@ static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
static int labpc_cs_attach(struct pcmcia_device *link)
{
- struct local_info_t *local;
int ret;
- 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;
@@ -197,6 +183,8 @@ static int labpc_cs_attach(struct pcmcia_device *link)
if (ret)
goto failed;
+ pcmcia_cur_dev = link;
+
return 0;
failed:
@@ -207,9 +195,6 @@ failed:
static void labpc_cs_detach(struct pcmcia_device *link)
{
pcmcia_disable_device(link);
-
- /* This points to the parent local_info_t struct (may be null) */
- kfree(link->priv);
}
static const struct pcmcia_device_id labpc_cs_ids[] = {