summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/mpc624.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/mpc624.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/mpc624.c')
-rw-r--r--drivers/staging/comedi/drivers/mpc624.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/staging/comedi/drivers/mpc624.c b/drivers/staging/comedi/drivers/mpc624.c
index f8b7faefc961..3e8892c82094 100644
--- a/drivers/staging/comedi/drivers/mpc624.c
+++ b/drivers/staging/comedi/drivers/mpc624.c
@@ -122,13 +122,12 @@ Configuration Options:
#define MPC624_SPEED_6_875_Hz \
(MPC624_OSR4 | MPC624_OSR3 | MPC624_OSR2 | MPC624_OSR1 | MPC624_OSR0)
/* -------------------------------------------------------------------------- */
-struct skel_private {
+struct mpc624_private {
/* set by mpc624_attach() from driver's parameters */
unsigned long int ulConvertionRate;
};
-#define devpriv ((struct skel_private *)dev->private)
/* -------------------------------------------------------------------------- */
static const struct comedi_lrange range_mpc624_bipolar1 = {
1,
@@ -155,6 +154,7 @@ static int mpc624_ai_rinsn(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn,
unsigned int *data)
{
+ struct mpc624_private *devpriv = dev->private;
int n, i;
unsigned long int data_in, data_out;
unsigned char ucPort;
@@ -283,6 +283,7 @@ static int mpc624_ai_rinsn(struct comedi_device *dev,
static int mpc624_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
+ struct mpc624_private *devpriv;
struct comedi_subdevice *s;
unsigned long iobase;
int ret;
@@ -297,9 +298,10 @@ static int mpc624_attach(struct comedi_device *dev, struct comedi_devconfig *it)
dev->iobase = iobase;
dev->board_name = "mpc624";
- /* Private structure initialization */
- if (alloc_private(dev, sizeof(struct skel_private)) < 0)
- return -ENOMEM;
+ ret = alloc_private(dev, sizeof(*devpriv));
+ if (ret)
+ return ret;
+ devpriv = dev->private;
switch (it->options[1]) {
case 0: