Commit a62a1764 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: comedi_bond: remove devpriv macro

This macro relies on a local variable having a specific name.
Remove it.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 90db97d5
...@@ -93,7 +93,7 @@ struct BondedDevice { ...@@ -93,7 +93,7 @@ struct BondedDevice {
/* this structure is for data unique to this hardware driver. If /* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure, several hardware drivers keep similar information in this structure,
feel free to suggest moving the variable to the struct comedi_device struct. */ feel free to suggest moving the variable to the struct comedi_device struct. */
struct Private { struct comedi_bond_private {
# define MAX_BOARD_NAME 256 # define MAX_BOARD_NAME 256
char name[MAX_BOARD_NAME]; char name[MAX_BOARD_NAME];
struct BondedDevice **devs; struct BondedDevice **devs;
...@@ -102,12 +102,6 @@ struct Private { ...@@ -102,12 +102,6 @@ struct Private {
unsigned nchans; unsigned nchans;
}; };
/*
* most drivers define the following macro to make it easy to
* access the private structure.
*/
#define devpriv ((struct Private *)dev->private)
/* DIO devices are slightly special. Although it is possible to /* DIO devices are slightly special. Although it is possible to
* implement the insn_read/insn_write interface, it is much more * implement the insn_read/insn_write interface, it is much more
* useful to applications if you implement the insn_bits interface. * useful to applications if you implement the insn_bits interface.
...@@ -117,6 +111,7 @@ static int bonding_dio_insn_bits(struct comedi_device *dev, ...@@ -117,6 +111,7 @@ static int bonding_dio_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data) struct comedi_insn *insn, unsigned int *data)
{ {
struct comedi_bond_private *devpriv = dev->private;
#define LSAMPL_BITS (sizeof(unsigned int)*8) #define LSAMPL_BITS (sizeof(unsigned int)*8)
unsigned nchans = LSAMPL_BITS, num_done = 0, i; unsigned nchans = LSAMPL_BITS, num_done = 0, i;
...@@ -163,6 +158,7 @@ static int bonding_dio_insn_config(struct comedi_device *dev, ...@@ -163,6 +158,7 @@ static int bonding_dio_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data) struct comedi_insn *insn, unsigned int *data)
{ {
struct comedi_bond_private *devpriv = dev->private;
int chan = CR_CHAN(insn->chanspec), ret, io_bits = s->io_bits; int chan = CR_CHAN(insn->chanspec), ret, io_bits = s->io_bits;
unsigned int io; unsigned int io;
struct BondedDevice *bdev; struct BondedDevice *bdev;
...@@ -216,6 +212,7 @@ static void *Realloc(const void *oldmem, size_t newlen, size_t oldlen) ...@@ -216,6 +212,7 @@ static void *Realloc(const void *oldmem, size_t newlen, size_t oldlen)
static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it) static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it)
{ {
struct comedi_bond_private *devpriv = dev->private;
int i; int i;
struct comedi_device *devs_opened[COMEDI_NUM_BOARD_MINORS]; struct comedi_device *devs_opened[COMEDI_NUM_BOARD_MINORS];
...@@ -319,20 +316,19 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -319,20 +316,19 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it)
static int bonding_attach(struct comedi_device *dev, static int bonding_attach(struct comedi_device *dev,
struct comedi_devconfig *it) struct comedi_devconfig *it)
{ {
struct comedi_bond_private *devpriv;
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret; int ret;
LOG_MSG("comedi%d\n", dev->minor); LOG_MSG("comedi%d\n", dev->minor);
/* ret = alloc_private(dev, sizeof(*devpriv));
* Allocate the private structure area. alloc_private() is a if (ret)
* convenient macro defined in comedidev.h. return ret;
*/ devpriv = dev->private;
if (alloc_private(dev, sizeof(struct Private)) < 0)
return -ENOMEM;
/* /*
* Setup our bonding from config params.. sets up our Private struct.. * Setup our bonding from config params.. sets up our private struct..
*/ */
if (!doDevConfig(dev, it)) if (!doDevConfig(dev, it))
return -EINVAL; return -EINVAL;
...@@ -362,6 +358,7 @@ static int bonding_attach(struct comedi_device *dev, ...@@ -362,6 +358,7 @@ static int bonding_attach(struct comedi_device *dev,
static void bonding_detach(struct comedi_device *dev) static void bonding_detach(struct comedi_device *dev)
{ {
struct comedi_bond_private *devpriv = dev->private;
unsigned long devs_closed = 0; unsigned long devs_closed = 0;
if (devpriv) { if (devpriv) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment