Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+195 −148

File changed.

Preview size limit exceeded, changes collapsed.

+3 −1
Original line number Diff line number Diff line
@@ -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;
+0 −2
Original line number Diff line number Diff line
@@ -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