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

staging: comedi: pcmmio: remove 'subpriv' macro

This macro relies on a local variable having a specific name. Remove
the macro and add a local variable where used.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 03a36f17
...@@ -260,8 +260,6 @@ struct pcmmio_private { ...@@ -260,8 +260,6 @@ struct pcmmio_private {
unsigned int ao_readback[8]; unsigned int ao_readback[8];
}; };
#define subpriv ((struct pcmmio_subdev_private *)s->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.
...@@ -271,6 +269,7 @@ static int pcmmio_dio_insn_bits(struct comedi_device *dev, ...@@ -271,6 +269,7 @@ static int pcmmio_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 pcmmio_subdev_private *subpriv = s->private;
int byte_no; int byte_no;
/* NOTE: /* NOTE:
...@@ -327,6 +326,7 @@ static int pcmmio_dio_insn_config(struct comedi_device *dev, ...@@ -327,6 +326,7 @@ static int pcmmio_dio_insn_config(struct comedi_device *dev,
struct comedi_insn *insn, struct comedi_insn *insn,
unsigned int *data) unsigned int *data)
{ {
struct pcmmio_subdev_private *subpriv = s->private;
unsigned int chan = CR_CHAN(insn->chanspec); unsigned int chan = CR_CHAN(insn->chanspec);
int byte_no = chan / 8; int byte_no = chan / 8;
int bit_no = chan % 8; int bit_no = chan % 8;
...@@ -379,6 +379,7 @@ static void pcmmio_reset(struct comedi_device *dev) ...@@ -379,6 +379,7 @@ static void pcmmio_reset(struct comedi_device *dev)
static void pcmmio_stop_intr(struct comedi_device *dev, static void pcmmio_stop_intr(struct comedi_device *dev,
struct comedi_subdevice *s) struct comedi_subdevice *s)
{ {
struct pcmmio_subdev_private *subpriv = s->private;
int nports, firstport, asic, port; int nports, firstport, asic, port;
asic = subpriv->dio.intr.asic; asic = subpriv->dio.intr.asic;
...@@ -457,7 +458,10 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d) ...@@ -457,7 +458,10 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d)
"got edge detect interrupt %d asic %d which_chans: %06x\n", "got edge detect interrupt %d asic %d which_chans: %06x\n",
irq, asic, triggered); irq, asic, triggered);
for (i = 2; i < dev->n_subdevices; i++) { for (i = 2; i < dev->n_subdevices; i++) {
struct pcmmio_subdev_private *subpriv;
s = &dev->subdevices[i]; s = &dev->subdevices[i];
subpriv = s->private;
/* /*
* this is an interrupt subdev, * this is an interrupt subdev,
* and it matches this asic! * and it matches this asic!
...@@ -556,6 +560,8 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d) ...@@ -556,6 +560,8 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d)
static int pcmmio_start_intr(struct comedi_device *dev, static int pcmmio_start_intr(struct comedi_device *dev,
struct comedi_subdevice *s) struct comedi_subdevice *s)
{ {
struct pcmmio_subdev_private *subpriv = s->private;
if (!subpriv->dio.intr.continuous && subpriv->dio.intr.stop_count == 0) { if (!subpriv->dio.intr.continuous && subpriv->dio.intr.stop_count == 0) {
/* An empty acquisition! */ /* An empty acquisition! */
s->async->events |= COMEDI_CB_EOA; s->async->events |= COMEDI_CB_EOA;
...@@ -623,6 +629,7 @@ static int pcmmio_start_intr(struct comedi_device *dev, ...@@ -623,6 +629,7 @@ static int pcmmio_start_intr(struct comedi_device *dev,
static int pcmmio_cancel(struct comedi_device *dev, struct comedi_subdevice *s) static int pcmmio_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
{ {
struct pcmmio_subdev_private *subpriv = s->private;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&subpriv->dio.intr.spinlock, flags); spin_lock_irqsave(&subpriv->dio.intr.spinlock, flags);
...@@ -640,6 +647,7 @@ static int ...@@ -640,6 +647,7 @@ static int
pcmmio_inttrig_start_intr(struct comedi_device *dev, struct comedi_subdevice *s, pcmmio_inttrig_start_intr(struct comedi_device *dev, struct comedi_subdevice *s,
unsigned int trignum) unsigned int trignum)
{ {
struct pcmmio_subdev_private *subpriv = s->private;
unsigned long flags; unsigned long flags;
int event = 0; int event = 0;
...@@ -663,6 +671,7 @@ pcmmio_inttrig_start_intr(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -663,6 +671,7 @@ pcmmio_inttrig_start_intr(struct comedi_device *dev, struct comedi_subdevice *s,
*/ */
static int pcmmio_cmd(struct comedi_device *dev, struct comedi_subdevice *s) static int pcmmio_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
{ {
struct pcmmio_subdev_private *subpriv = s->private;
struct comedi_cmd *cmd = &s->async->cmd; struct comedi_cmd *cmd = &s->async->cmd;
unsigned long flags; unsigned long flags;
int event = 0; int event = 0;
...@@ -918,6 +927,7 @@ static int pcmmio_ao_insn_write(struct comedi_device *dev, ...@@ -918,6 +927,7 @@ static int pcmmio_ao_insn_write(struct comedi_device *dev,
static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it) static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{ {
struct pcmmio_private *devpriv; struct pcmmio_private *devpriv;
struct pcmmio_subdev_private *subpriv;
struct comedi_subdevice *s; struct comedi_subdevice *s;
int sdev_no, chans_left, n_dio_subdevs, n_subdevs, port, asic, int sdev_no, chans_left, n_dio_subdevs, n_subdevs, port, asic,
thisasic_chanct = 0; thisasic_chanct = 0;
...@@ -981,7 +991,8 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -981,7 +991,8 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
int byte_no; int byte_no;
s = &dev->subdevices[sdev_no]; s = &dev->subdevices[sdev_no];
s->private = &devpriv->sprivs[sdev_no]; subpriv = &devpriv->sprivs[sdev_no];
s->private = subpriv;
s->maxdata = 1; s->maxdata = 1;
s->range_table = &range_digital; s->range_table = &range_digital;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE; s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
......
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