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

staging: comedi: ni_stc.h: add some 'is_{board type}' flags to private data

The board->reg_type if checked quite often in the ni_mio_common.c code to
handle differences in the PCI devices supported by the ni_pcimio driver.
Simplify the code a bit by adding some 'is_{board type}' bit-field flags
to the private data.
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 bfb0c28b
......@@ -1209,6 +1209,24 @@ static int pcimio_auto_attach(struct comedi_device *dev,
if (board->reg_type & ni_reg_m_series_mask)
devpriv->is_m_series = 1;
if (board->reg_type & ni_reg_6xxx_mask)
devpriv->is_6xxx = 1;
if (board->reg_type == ni_reg_611x)
devpriv->is_611x = 1;
if (board->reg_type == ni_reg_6143)
devpriv->is_6143 = 1;
if (board->reg_type == ni_reg_622x)
devpriv->is_622x = 1;
if (board->reg_type == ni_reg_625x)
devpriv->is_625x = 1;
if (board->reg_type == ni_reg_628x)
devpriv->is_628x = 1;
if (board->reg_type & ni_reg_67xx_mask)
devpriv->is_67xx = 1;
if (board->reg_type == ni_reg_6711)
devpriv->is_6711 = 1;
if (board->reg_type == ni_reg_6713)
devpriv->is_6713 = 1;
ret = mite_setup(devpriv->mite);
if (ret < 0) {
......@@ -1234,7 +1252,7 @@ static int pcimio_auto_attach(struct comedi_device *dev,
if (devpriv->is_m_series)
m_series_init_eeprom_buffer(dev);
if (board->reg_type == ni_reg_6143)
if (devpriv->is_6143)
init_6143(dev);
irq = pcidev->irq;
......
......@@ -1491,7 +1491,17 @@ struct ni_private {
struct mite_dma_descriptor_ring *cdo_mite_ring;
struct mite_dma_descriptor_ring *gpct_mite_ring[NUM_GPCT];
/* ni_pcimio board type flags (based on the boardinfo reg_type) */
unsigned int is_m_series:1;
unsigned int is_6xxx:1;
unsigned int is_611x:1;
unsigned int is_6143:1;
unsigned int is_622x:1;
unsigned int is_625x:1;
unsigned int is_628x:1;
unsigned int is_67xx:1;
unsigned int is_6711:1;
unsigned int is_6713:1;
};
#endif /* _COMEDI_NI_STC_H */
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