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

staging: comedi: ni_stc.h: remove boardtype macro

This macro relies on a local variable having a specific name and
returns an object that variable points to. This object is the
boardinfo used by the driver.

The comedi core provides the comedi_board() helper to return a
const pointer to the boardinfo. Remove the 'boardtype' macro and
fix all the users of the 'boardtype' macro to use the comedi_board()
helper to get the const boardinfo 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 a25a701a
...@@ -1571,6 +1571,7 @@ static void m_series_init_eeprom_buffer(struct comedi_device *dev) ...@@ -1571,6 +1571,7 @@ static void m_series_init_eeprom_buffer(struct comedi_device *dev)
static void init_6143(struct comedi_device *dev) static void init_6143(struct comedi_device *dev)
{ {
const struct ni_board_struct *board = comedi_board(dev);
struct ni_private *devpriv = dev->private; struct ni_private *devpriv = dev->private;
/* Disable interrupts */ /* Disable interrupts */
...@@ -1581,7 +1582,8 @@ static void init_6143(struct comedi_device *dev) ...@@ -1581,7 +1582,8 @@ static void init_6143(struct comedi_device *dev)
ni_writeb(0x80, PipelineDelay_6143); /* Set EOCMode, ADCMode and pipelinedelay */ ni_writeb(0x80, PipelineDelay_6143); /* Set EOCMode, ADCMode and pipelinedelay */
ni_writeb(0x00, EOC_Set_6143); /* Set EOC Delay */ ni_writeb(0x00, EOC_Set_6143); /* Set EOC Delay */
ni_writel(boardtype.ai_fifo_depth / 2, AIFIFO_Flag_6143); /* Set the FIFO half full level */ /* Set the FIFO half full level */
ni_writel(board->ai_fifo_depth / 2, AIFIFO_Flag_6143);
/* Strobe Relay disable bit */ /* Strobe Relay disable bit */
devpriv->ai_calib_source_enabled = 0; devpriv->ai_calib_source_enabled = 0;
......
...@@ -1423,8 +1423,6 @@ struct ni_board_struct { ...@@ -1423,8 +1423,6 @@ struct ni_board_struct {
#define n_ni_boards (sizeof(ni_boards)/sizeof(struct ni_board_struct)) #define n_ni_boards (sizeof(ni_boards)/sizeof(struct ni_board_struct))
#define boardtype (*(struct ni_board_struct *)dev->board_ptr)
#define MAX_N_AO_CHAN 8 #define MAX_N_AO_CHAN 8
#define NUM_GPCT 2 #define NUM_GPCT 2
......
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