From 93d59e3c63d7ee392f92077a884cee03f4c9cf93 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Fri, 24 Aug 2001 20:15:29 +0000 Subject: [PATCH] fixed symbol leaks noted by check_driver --- comedi/drivers/cb_pcidas.c | 8 ++++---- comedi/drivers/das16.c | 4 ++-- comedi/drivers/das1800.c | 28 ++++++++++++++-------------- comedi/drivers/das800.c | 18 +++++++++--------- comedi/drivers/ni_at_a2150.c | 12 +++++++++--- 5 files changed, 38 insertions(+), 32 deletions(-) diff --git a/comedi/drivers/cb_pcidas.c b/comedi/drivers/cb_pcidas.c index 78441930..6508c11d 100644 --- a/comedi/drivers/cb_pcidas.c +++ b/comedi/drivers/cb_pcidas.c @@ -167,7 +167,7 @@ static const int max_fifo_size = 1024; // maximum fifo size of any supported boa // bit in hexadecimal representation of range index that indicates unipolar input range #define IS_UNIPOLAR 0x4 // analog input ranges for most boards -comedi_lrange cb_pcidas_ranges = +static comedi_lrange cb_pcidas_ranges = { 8, { @@ -183,7 +183,7 @@ comedi_lrange cb_pcidas_ranges = }; // pci-das1001 input ranges -comedi_lrange cb_pcidas_alt_ranges = +static comedi_lrange cb_pcidas_alt_ranges = { 8, { @@ -199,7 +199,7 @@ comedi_lrange cb_pcidas_alt_ranges = }; // analog output ranges -comedi_lrange cb_pcidas_ao_ranges = +static comedi_lrange cb_pcidas_ao_ranges = { 4, { @@ -1423,7 +1423,7 @@ static int cb_pcidas_ao_cancel(comedi_device *dev, comedi_subdevice *s) return 0; } -void cb_pcidas_load_counters(comedi_device *dev, unsigned int *ns, int rounding_flags) +static void cb_pcidas_load_counters(comedi_device *dev, unsigned int *ns, int rounding_flags) { i8253_cascade_ns_to_timer_2div(TIMER_BASE, &(devpriv->divisor1), &(devpriv->divisor2), ns, rounding_flags & TRIG_ROUND_MASK); diff --git a/comedi/drivers/das16.c b/comedi/drivers/das16.c index 7fd770ac..79abe12d 100644 --- a/comedi/drivers/das16.c +++ b/comedi/drivers/das16.c @@ -258,7 +258,7 @@ static void das16_interrupt(int irq, void *d, struct pt_regs *regs); static unsigned int das16_set_pacer(comedi_device *dev, unsigned int ns, int flags); static int das1600_mode_detect(comedi_device *dev); -unsigned int das16_suggest_transfer_size(comedi_cmd cmd); +static unsigned int das16_suggest_transfer_size(comedi_cmd cmd); #ifdef DEBUG static void reg_dump(comedi_device *dev); @@ -1450,7 +1450,7 @@ static int das16_detach(comedi_device *dev) COMEDI_INITCLEANUP(driver_das16); // utility function that suggests a dma transfer size in bytes -unsigned int das16_suggest_transfer_size(comedi_cmd cmd) +static unsigned int das16_suggest_transfer_size(comedi_cmd cmd) { unsigned int size; unsigned int freq; diff --git a/comedi/drivers/das1800.c b/comedi/drivers/das1800.c index 3c336286..4c2c679d 100644 --- a/comedi/drivers/das1800.c +++ b/comedi/drivers/das1800.c @@ -174,9 +174,9 @@ static int das1800_ao_winsn(comedi_device *dev, comedi_subdevice *s, comedi_insn static int das1800_di_rbits(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data); static int das1800_do_wbits(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data); -int das1800_set_frequency(comedi_device *dev); -unsigned int burst_convert_arg(unsigned int convert_arg, int round_mode); -unsigned int suggest_transfer_size(comedi_device *dev, unsigned int ns); +static int das1800_set_frequency(comedi_device *dev); +static unsigned int burst_convert_arg(unsigned int convert_arg, int round_mode); +static unsigned int suggest_transfer_size(comedi_device *dev, unsigned int ns); // analog input ranges static comedi_lrange range_ai_das1801 = { @@ -223,7 +223,7 @@ typedef struct das1800_board_struct{ * not always achievable depending on board setup (see * user manual.) */ -das1800_board das1800_boards[] = +static das1800_board das1800_boards[] = { { name: "das-1701st", @@ -593,7 +593,7 @@ static int das1800_attach(comedi_device *dev, comedi_devconfig *it) break; } -//dma stuff + //dma stuff // need an irq to do dma if(irq) { @@ -764,7 +764,7 @@ static int das1800_detach(comedi_device *dev) /* probes and checks das-1800 series board type */ -int das1800_probe(comedi_device *dev) +static int das1800_probe(comedi_device *dev) { int id; int board; @@ -1297,7 +1297,7 @@ static int das1800_ai_do_cmdtest(comedi_device *dev,comedi_subdevice *s,comedi_c // first, some utility functions used in the main ai_do_cmd() // returns appropriate bits for control register a, depending on command -int control_a_bits(comedi_cmd cmd) +static int control_a_bits(comedi_cmd cmd) { int control_a; @@ -1322,7 +1322,7 @@ int control_a_bits(comedi_cmd cmd) } // returns appropriate bits for control register c, depending on command -int control_c_bits(comedi_cmd cmd) +static int control_c_bits(comedi_cmd cmd) { int control_c; int aref; @@ -1372,7 +1372,7 @@ int control_c_bits(comedi_cmd cmd) } // sets up counters -int setup_counters(comedi_device *dev, comedi_cmd cmd) +static int setup_counters(comedi_device *dev, comedi_cmd cmd) { // setup cascaded counters for conversion/scan frequency switch(cmd.scan_begin_src) @@ -1413,7 +1413,7 @@ int setup_counters(comedi_device *dev, comedi_cmd cmd) } // sets up dma -void setup_dma(comedi_device *dev, comedi_cmd cmd) +static void setup_dma(comedi_device *dev, comedi_cmd cmd) { unsigned long lock_flags; const int dual_dma = devpriv->irq_dma_bits & DMA_DUAL; @@ -1465,7 +1465,7 @@ void setup_dma(comedi_device *dev, comedi_cmd cmd) } // programs channel/gain list into card -void program_chanlist(comedi_device *dev, comedi_cmd cmd) +static void program_chanlist(comedi_device *dev, comedi_cmd cmd) { int i, n, chan_range; unsigned long irq_flags; @@ -1680,7 +1680,7 @@ static int das1800_do_wbits(comedi_device *dev, comedi_subdevice *s, comedi_insn } /* loads counters with divisor1, divisor2 from private structure */ -int das1800_set_frequency(comedi_device *dev) +static int das1800_set_frequency(comedi_device *dev) { int err = 0; @@ -1697,7 +1697,7 @@ int das1800_set_frequency(comedi_device *dev) /* converts requested conversion timing to timing compatible with * hardware, used only when card is in 'burst mode' */ -unsigned int burst_convert_arg(unsigned int convert_arg, int round_mode) +static unsigned int burst_convert_arg(unsigned int convert_arg, int round_mode) { unsigned int micro_sec; @@ -1725,7 +1725,7 @@ unsigned int burst_convert_arg(unsigned int convert_arg, int round_mode) } // utility function that suggests a dma transfer size based on the conversion period 'ns' -unsigned int suggest_transfer_size(comedi_device *dev, unsigned int ns) +static unsigned int suggest_transfer_size(comedi_device *dev, unsigned int ns) { unsigned int size; unsigned int freq = 1000000000 / ns; diff --git a/comedi/drivers/das800.c b/comedi/drivers/das800.c index 7e565f1b..280def31 100644 --- a/comedi/drivers/das800.c +++ b/comedi/drivers/das800.c @@ -185,7 +185,7 @@ static comedi_lrange range_das80216_ai = { enum{das800, ciodas800, das801, ciodas801, das802, ciodas802, ciodas80216}; -das800_board das800_boards[] = +static das800_board das800_boards[] = { { name: "das-800", @@ -260,18 +260,18 @@ comedi_driver driver_das800={ }; static void das800_interrupt(int irq, void *d, struct pt_regs *regs); -void enable_das800(comedi_device *dev); -void disable_das800(comedi_device *dev); +static void enable_das800(comedi_device *dev); +static void disable_das800(comedi_device *dev); static int das800_ai_do_cmdtest(comedi_device *dev,comedi_subdevice *s,comedi_cmd *cmd); static int das800_ai_do_cmd(comedi_device *dev, comedi_subdevice *s); static int das800_ai_rinsn(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data); static int das800_di_rbits(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data); static int das800_do_wbits(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data); -int das800_probe(comedi_device *dev); -int das800_set_frequency(comedi_device *dev); +static int das800_probe(comedi_device *dev); +static int das800_set_frequency(comedi_device *dev); /* checks and probes das-800 series board type */ -int das800_probe(comedi_device *dev) +static int das800_probe(comedi_device *dev) { int id_bits; unsigned long irq_flags; @@ -582,7 +582,7 @@ static int das800_cancel(comedi_device *dev, comedi_subdevice *s) } /* enable_das800 makes the card start taking hardware triggered conversions */ -void enable_das800(comedi_device *dev) +static void enable_das800(comedi_device *dev) { unsigned long irq_flags; comedi_spin_lock_irqsave(&dev->spinlock, irq_flags); @@ -597,7 +597,7 @@ void enable_das800(comedi_device *dev) } /* disable_das800 stops hardware triggered conversions */ -void disable_das800(comedi_device *dev) +static void disable_das800(comedi_device *dev) { unsigned long irq_flags; comedi_spin_lock_irqsave(&dev->spinlock, irq_flags); @@ -902,7 +902,7 @@ static int das800_do_wbits(comedi_device *dev, comedi_subdevice *s, comedi_insn } /* loads counters with divisor1, divisor2 from private structure */ -int das800_set_frequency(comedi_device *dev) +static int das800_set_frequency(comedi_device *dev) { int err = 0; diff --git a/comedi/drivers/ni_at_a2150.c b/comedi/drivers/ni_at_a2150.c index 44be8cb3..fd933194 100644 --- a/comedi/drivers/ni_at_a2150.c +++ b/comedi/drivers/ni_at_a2150.c @@ -66,7 +66,8 @@ TRIG_WAKE_EOS #define A2150_SIZE 28 #define A2150_DMA_BUFFER_SIZE 0xff00 // size in bytes of dma buffer -#define A2150_DEBUG // enable debugging code +//#define A2150_DEBUG // enable debugging code +#undef A2150_DEBUG // disable debugging code /* Registers and bits */ #define CONFIG_REG 0x0 @@ -126,7 +127,7 @@ static comedi_lrange range_a2150 = { // enum must match board indices enum{a2150_c, a2150_s}; -a2150_board a2150_boards[] = +static a2150_board a2150_boards[] = { { name: "at-a2150c", @@ -183,7 +184,7 @@ COMEDI_INITCLEANUP(driver_a2150); #ifdef A2150_DEBUG -void ni_dump_regs(comedi_device *dev) +static void ni_dump_regs(comedi_device *dev) { rt_printk("config bits 0x%x\n", devpriv->config_bits); rt_printk("irq dma bits 0x%x\n", devpriv->irq_dma_bits); @@ -689,6 +690,10 @@ static int a2150_ai_cmd(comedi_device *dev, comedi_subdevice *s) enable_dma(devpriv->dma); release_dma_lock(lock_flags); + /* clear dma interrupt before enabling it, to try and get rid of that + * one spurious interrupt that has been happening */ + outw(0x00, dev->iobase + DMA_TC_CLEAR_REG); + // enable dma on card devpriv->irq_dma_bits |= DMA_INTR_EN_BIT | DMA_EN_BIT; outw(devpriv->irq_dma_bits, dev->iobase + IRQ_DMA_CNTRL_REG); @@ -734,6 +739,7 @@ static int a2150_ai_cmd(comedi_device *dev, comedi_subdevice *s) return 0; } +// XXX doesn't seem to work static int a2150_ai_rinsn(comedi_device *dev, comedi_subdevice *s, comedi_insn *insn, lsampl_t *data) { unsigned int i, n; -- 2.26.2