summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/ni_labpc_cs.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-10-15 10:15:52 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-22 12:00:54 -0700
commit9a1a6cf8ae5ca58171e117335b9983e3cfa2185c (patch)
treee5bfb37438374575edc2b7e28a997b9f869ae382 /drivers/staging/comedi/drivers/ni_labpc_cs.c
parent0e05c55226bffcdd3f1393d5ab74cd0d9faff385 (diff)
staging: comedi: drivers: remove remaining devpriv macros
The remaining comedi drivers that still have a devpriv macro are all pretty straight forward for removing the devpriv macro. This macro relies on a local variable having a specific name. Remove its use by replacing it with a local variable where used. The inline function alloc_private(), used to kzalloc the dev->private memory, returns non-zero if there is an error. Fix all the alloc_private() calls accordingly and remove any kernel messages or obvious comments that still exist in the drivers. Leave a comment in the skel driver. 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/drivers/ni_labpc_cs.c')
-rw-r--r--drivers/staging/comedi/drivers/ni_labpc_cs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c
index eb0417eb6d7d..791a66ff65a0 100644
--- a/drivers/staging/comedi/drivers/ni_labpc_cs.c
+++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c
@@ -127,13 +127,16 @@ static struct comedi_driver driver_labpc_cs = {
static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
+ struct labpc_private *devpriv;
unsigned long iobase = 0;
unsigned int irq = 0;
struct pcmcia_device *link;
+ int ret;
- /* allocate and initialize dev->private */
- if (alloc_private(dev, sizeof(struct labpc_private)) < 0)
- return -ENOMEM;
+ ret = alloc_private(dev, sizeof(*devpriv));
+ if (ret)
+ return ret;
+ devpriv = dev->private;
/* get base address, irq etc. based on bustype */
switch (thisboard->bustype) {