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: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
H Hartley Sweeten 2013-03-05 10:20:41 -07:00 committed by Greg Kroah-Hartman
parent a25a701afa
commit 6293e35742
3 changed files with 198 additions and 151 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1571,6 +1571,7 @@ static void m_series_init_eeprom_buffer(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;
/* Disable interrupts */
@ -1581,7 +1582,8 @@ static void init_6143(struct comedi_device *dev)
ni_writeb(0x80, PipelineDelay_6143); /* Set EOCMode, ADCMode and pipelinedelay */
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 */
devpriv->ai_calib_source_enabled = 0;

View File

@ -1423,8 +1423,6 @@ 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 NUM_GPCT 2