staging: comedi: ni_labpc: remove range_labpc_1200_ai export
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 23 Apr 2013 19:57:58 +0000 (12:57 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 May 2013 21:32:30 +0000 (14:32 -0700)
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 <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_labpc.c
drivers/staging/comedi/drivers/ni_labpc.h
drivers/staging/comedi/drivers/ni_labpc_cs.c
drivers/staging/comedi/drivers/ni_labpc_pci.c

index da10a762e8c24e56c321c43b21a3d11ed14968a2..5ed9a6fef96b0292b21a5b97998c8e622dc0d9a6 100644 (file)
@@ -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;
index f4381815efe9e32daf54242b38a615d5951d75c0..a309aa07121683c76fcb879c3d254097f63d80be 100644 (file)
@@ -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 */
index 2c1ea01f5a645336312304febae07fddb20b7e4a..9bbdee5627ec3bedf43f4185580351d54a046fe0 100644 (file)
@@ -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,
index b993b69459ae4144a36a4f730aedb1e51316f087..4b472db141288cb0baa2f2bd93572a14c400569a 100644 (file)
@@ -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,