From 70d52bce5523f2c6a7bf3f9a54dacc0be112a3e8 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Tue, 23 Apr 2013 12:57:58 -0700 Subject: [PATCH] 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: H Hartley Sweeten Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_labpc.c | 9 +++------ drivers/staging/comedi/drivers/ni_labpc.h | 2 -- drivers/staging/comedi/drivers/ni_labpc_cs.c | 1 - drivers/staging/comedi/drivers/ni_labpc_pci.c | 1 - 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c index da10a762e8c2..5ed9a6fef96b 100644 --- a/drivers/staging/comedi/drivers/ni_labpc.c +++ b/drivers/staging/comedi/drivers/ni_labpc.c @@ -185,7 +185,7 @@ const int 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, { BIP_RANGE(5), BIP_RANGE(2.5), @@ -203,7 +203,6 @@ const struct comedi_lrange range_labpc_1200_ai = { UNI_RANGE(0.1) } }; -EXPORT_SYMBOL_GPL(range_labpc_1200_ai); static const struct comedi_lrange range_labpc_ao = { 2, { @@ -238,7 +237,6 @@ static inline void labpc_writeb(unsigned int byte, unsigned long address) static const struct labpc_boardinfo labpc_boards[] = { { .name = "lab-pc-1200", - .ai_range_table = &range_labpc_1200_ai, .ai_range_code = labpc_1200_ai_gain_bits, .ai_speed = 10000, .ai_scan_up = 1, @@ -246,14 +244,12 @@ static const struct labpc_boardinfo labpc_boards[] = { .is_labpc1200 = 1, }, { .name = "lab-pc-1200ai", - .ai_range_table = &range_labpc_1200_ai, .ai_range_code = labpc_1200_ai_gain_bits, .ai_speed = 10000, .ai_scan_up = 1, .is_labpc1200 = 1, }, { .name = "lab-pc+", - .ai_range_table = &range_labpc_plus_ai, .ai_range_code = labpc_plus_ai_gain_bits, .ai_speed = 12000, .has_ao = 1, @@ -1625,7 +1621,8 @@ int labpc_common_attach(struct comedi_device *dev, s->n_chan = 8; s->len_chanlist = 8; 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; if (dev->irq) { dev->read_subdev = s; diff --git a/drivers/staging/comedi/drivers/ni_labpc.h b/drivers/staging/comedi/drivers/ni_labpc.h index f4381815efe9..a309aa071216 100644 --- a/drivers/staging/comedi/drivers/ni_labpc.h +++ b/drivers/staging/comedi/drivers/ni_labpc.h @@ -33,7 +33,6 @@ enum transfer_type { fifo_not_empty_transfer, fifo_half_full_transfer, struct labpc_boardinfo { const char *name; - const struct comedi_lrange *ai_range_table; const int *ai_range_code; int ai_speed; /* maximum input speed in ns */ unsigned ai_scan_up:1; /* can auto scan up in ai channels */ @@ -95,6 +94,5 @@ int labpc_common_attach(struct comedi_device *dev, void labpc_common_detach(struct comedi_device *dev); extern const int labpc_1200_ai_gain_bits[]; -extern const struct comedi_lrange range_labpc_1200_ai; #endif /* _NI_LABPC_H */ diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c index 2c1ea01f5a64..9bbdee5627ec 100644 --- a/drivers/staging/comedi/drivers/ni_labpc_cs.c +++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c @@ -76,7 +76,6 @@ NI manuals: static const struct labpc_boardinfo labpc_cs_boards[] = { { .name = "daqcard-1200", - .ai_range_table = &range_labpc_1200_ai, .ai_range_code = labpc_1200_ai_gain_bits, .ai_speed = 10000, .has_ao = 1, diff --git a/drivers/staging/comedi/drivers/ni_labpc_pci.c b/drivers/staging/comedi/drivers/ni_labpc_pci.c index b993b69459ae..4b472db14128 100644 --- a/drivers/staging/comedi/drivers/ni_labpc_pci.c +++ b/drivers/staging/comedi/drivers/ni_labpc_pci.c @@ -49,7 +49,6 @@ enum labpc_pci_boardid { static const struct labpc_boardinfo labpc_pci_boards[] = { [BOARD_NI_PCI1200] = { .name = "ni_pci-1200", - .ai_range_table = &range_labpc_1200_ai, .ai_range_code = labpc_1200_ai_gain_bits, .ai_speed = 10000, .ai_scan_up = 1, -- 2.30.2