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

staging: comedi: ni_labpc: remove range_labpc_1200_ai export

The 'ai_range_table' boardinfo is only used to initialize the
analog input subdevice s->range_table. We can use the 'is_labpc1200'
flag in the boardinfo to determine which range table is needed.

This allows making range_labpc_1200_ai static and removing the
export as well as removing the 'ai_range_table' from the boardinfo.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 63d6ba20
...@@ -185,7 +185,7 @@ const int labpc_1200_ai_gain_bits[] = { ...@@ -185,7 +185,7 @@ const int labpc_1200_ai_gain_bits[] = {
}; };
EXPORT_SYMBOL_GPL(labpc_1200_ai_gain_bits); EXPORT_SYMBOL_GPL(labpc_1200_ai_gain_bits);
const struct comedi_lrange range_labpc_1200_ai = { static const struct comedi_lrange range_labpc_1200_ai = {
14, { 14, {
BIP_RANGE(5), BIP_RANGE(5),
BIP_RANGE(2.5), BIP_RANGE(2.5),
...@@ -203,7 +203,6 @@ const struct comedi_lrange range_labpc_1200_ai = { ...@@ -203,7 +203,6 @@ const struct comedi_lrange range_labpc_1200_ai = {
UNI_RANGE(0.1) UNI_RANGE(0.1)
} }
}; };
EXPORT_SYMBOL_GPL(range_labpc_1200_ai);
static const struct comedi_lrange range_labpc_ao = { static const struct comedi_lrange range_labpc_ao = {
2, { 2, {
...@@ -238,7 +237,6 @@ static inline void labpc_writeb(unsigned int byte, unsigned long address) ...@@ -238,7 +237,6 @@ static inline void labpc_writeb(unsigned int byte, unsigned long address)
static const struct labpc_boardinfo labpc_boards[] = { static const struct labpc_boardinfo labpc_boards[] = {
{ {
.name = "lab-pc-1200", .name = "lab-pc-1200",
.ai_range_table = &range_labpc_1200_ai,
.ai_range_code = labpc_1200_ai_gain_bits, .ai_range_code = labpc_1200_ai_gain_bits,
.ai_speed = 10000, .ai_speed = 10000,
.ai_scan_up = 1, .ai_scan_up = 1,
...@@ -246,14 +244,12 @@ static const struct labpc_boardinfo labpc_boards[] = { ...@@ -246,14 +244,12 @@ static const struct labpc_boardinfo labpc_boards[] = {
.is_labpc1200 = 1, .is_labpc1200 = 1,
}, { }, {
.name = "lab-pc-1200ai", .name = "lab-pc-1200ai",
.ai_range_table = &range_labpc_1200_ai,
.ai_range_code = labpc_1200_ai_gain_bits, .ai_range_code = labpc_1200_ai_gain_bits,
.ai_speed = 10000, .ai_speed = 10000,
.ai_scan_up = 1, .ai_scan_up = 1,
.is_labpc1200 = 1, .is_labpc1200 = 1,
}, { }, {
.name = "lab-pc+", .name = "lab-pc+",
.ai_range_table = &range_labpc_plus_ai,
.ai_range_code = labpc_plus_ai_gain_bits, .ai_range_code = labpc_plus_ai_gain_bits,
.ai_speed = 12000, .ai_speed = 12000,
.has_ao = 1, .has_ao = 1,
...@@ -1625,7 +1621,8 @@ int labpc_common_attach(struct comedi_device *dev, ...@@ -1625,7 +1621,8 @@ int labpc_common_attach(struct comedi_device *dev,
s->n_chan = 8; s->n_chan = 8;
s->len_chanlist = 8; s->len_chanlist = 8;
s->maxdata = 0x0fff; s->maxdata = 0x0fff;
s->range_table = board->ai_range_table; s->range_table = board->is_labpc1200
? &range_labpc_1200_ai : &range_labpc_plus_ai;
s->insn_read = labpc_ai_insn_read; s->insn_read = labpc_ai_insn_read;
if (dev->irq) { if (dev->irq) {
dev->read_subdev = s; dev->read_subdev = s;
......
...@@ -33,7 +33,6 @@ enum transfer_type { fifo_not_empty_transfer, fifo_half_full_transfer, ...@@ -33,7 +33,6 @@ enum transfer_type { fifo_not_empty_transfer, fifo_half_full_transfer,
struct labpc_boardinfo { struct labpc_boardinfo {
const char *name; const char *name;
const struct comedi_lrange *ai_range_table;
const int *ai_range_code; const int *ai_range_code;
int ai_speed; /* maximum input speed in ns */ int ai_speed; /* maximum input speed in ns */
unsigned ai_scan_up:1; /* can auto scan up in ai channels */ unsigned ai_scan_up:1; /* can auto scan up in ai channels */
...@@ -95,6 +94,5 @@ int labpc_common_attach(struct comedi_device *dev, ...@@ -95,6 +94,5 @@ int labpc_common_attach(struct comedi_device *dev,
void labpc_common_detach(struct comedi_device *dev); void labpc_common_detach(struct comedi_device *dev);
extern const int labpc_1200_ai_gain_bits[]; extern const int labpc_1200_ai_gain_bits[];
extern const struct comedi_lrange range_labpc_1200_ai;
#endif /* _NI_LABPC_H */ #endif /* _NI_LABPC_H */
...@@ -76,7 +76,6 @@ NI manuals: ...@@ -76,7 +76,6 @@ NI manuals:
static const struct labpc_boardinfo labpc_cs_boards[] = { static const struct labpc_boardinfo labpc_cs_boards[] = {
{ {
.name = "daqcard-1200", .name = "daqcard-1200",
.ai_range_table = &range_labpc_1200_ai,
.ai_range_code = labpc_1200_ai_gain_bits, .ai_range_code = labpc_1200_ai_gain_bits,
.ai_speed = 10000, .ai_speed = 10000,
.has_ao = 1, .has_ao = 1,
......
...@@ -49,7 +49,6 @@ enum labpc_pci_boardid { ...@@ -49,7 +49,6 @@ enum labpc_pci_boardid {
static const struct labpc_boardinfo labpc_pci_boards[] = { static const struct labpc_boardinfo labpc_pci_boards[] = {
[BOARD_NI_PCI1200] = { [BOARD_NI_PCI1200] = {
.name = "ni_pci-1200", .name = "ni_pci-1200",
.ai_range_table = &range_labpc_1200_ai,
.ai_range_code = labpc_1200_ai_gain_bits, .ai_range_code = labpc_1200_ai_gain_bits,
.ai_speed = 10000, .ai_speed = 10000,
.ai_scan_up = 1, .ai_scan_up = 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