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

staging: comedi: ni_at_a2150: remove 'thisboard' macro

The 'thisboard' macro relies on a local variable having a specific
name and yields a pointer derived from that local variable.

Replace the macro with local variables and use the comedi_board()
helper to get the pointer.
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 a56ec2fe
...@@ -154,11 +154,6 @@ static const struct a2150_board a2150_boards[] = { ...@@ -154,11 +154,6 @@ static const struct a2150_board a2150_boards[] = {
}, },
}; };
/*
* Useful for shorthand access to the particular board structure
*/
#define thisboard ((const struct a2150_board *)dev->board_ptr)
struct a2150_private { struct a2150_private {
volatile unsigned int count; /* number of data points left to be taken */ volatile unsigned int count; /* number of data points left to be taken */
...@@ -319,6 +314,7 @@ static int a2150_cancel(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -319,6 +314,7 @@ static int a2150_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
static int a2150_ai_cmdtest(struct comedi_device *dev, static int a2150_ai_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_cmd *cmd) struct comedi_subdevice *s, struct comedi_cmd *cmd)
{ {
const struct a2150_board *thisboard = comedi_board(dev);
int err = 0; int err = 0;
int tmp; int tmp;
int startChan; int startChan;
...@@ -604,6 +600,7 @@ static int a2150_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -604,6 +600,7 @@ static int a2150_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
static int a2150_get_timing(struct comedi_device *dev, unsigned int *period, static int a2150_get_timing(struct comedi_device *dev, unsigned int *period,
int flags) int flags)
{ {
const struct a2150_board *thisboard = comedi_board(dev);
struct a2150_private *devpriv = dev->private; struct a2150_private *devpriv = dev->private;
int lub, glb, temp; int lub, glb, temp;
int lub_divisor_shift, lub_index, glb_divisor_shift, glb_index; int lub_divisor_shift, lub_index, glb_divisor_shift, glb_index;
...@@ -719,6 +716,7 @@ static int a2150_probe(struct comedi_device *dev) ...@@ -719,6 +716,7 @@ static int a2150_probe(struct comedi_device *dev)
static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it) static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{ {
const struct a2150_board *thisboard = comedi_board(dev);
struct a2150_private *devpriv; struct a2150_private *devpriv;
struct comedi_subdevice *s; struct comedi_subdevice *s;
unsigned long iobase = it->options[0]; unsigned long iobase = it->options[0];
...@@ -797,6 +795,7 @@ static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -797,6 +795,7 @@ static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it)
} }
dev->board_ptr = a2150_boards + a2150_probe(dev); dev->board_ptr = a2150_boards + a2150_probe(dev);
thisboard = comedi_board(dev);
dev->board_name = thisboard->name; dev->board_name = thisboard->name;
ret = comedi_alloc_subdevices(dev, 1); ret = comedi_alloc_subdevices(dev, 1);
......
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