From b283c801ce71b34f3055a7ce77172a3a04b91152 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 4 Sep 2001 00:31:44 +0000 Subject: [PATCH] Fix symbol leakage in a bunch of drivers --- comedi/drivers/amplc_pci230.c | 4 ++-- comedi/drivers/cb_pcidda.c | 4 ++-- comedi/drivers/dt2801.c | 15 ++++----------- comedi/drivers/dt2811.c | 14 +++++++------- comedi/drivers/pcl711.c | 4 ++-- comedi/drivers/pcl726.c | 6 +++--- comedi/drivers/pcl812.c | 16 ++++++++-------- comedi/drivers/pcl818.c | 36 +++++++++++++++++------------------ comedi/drivers/pcmad.c | 4 ++-- comedi/drivers/rtd520.c | 27 ++++---------------------- comedi/drivers/skel.c | 4 ++-- 11 files changed, 54 insertions(+), 80 deletions(-) diff --git a/comedi/drivers/amplc_pci230.c b/comedi/drivers/amplc_pci230.c index 996b6bc8..c8eb7ce8 100644 --- a/comedi/drivers/amplc_pci230.c +++ b/comedi/drivers/amplc_pci230.c @@ -146,7 +146,7 @@ typedef struct pci230_board_struct{ int ao_bits; int have_dio; }pci230_board; -pci230_board pci230_boards[] = { +static pci230_board pci230_boards[] = { { name: "Amplicon PCI230", id: PCI_DEVICE_ID_PCI230, @@ -222,7 +222,7 @@ static comedi_lrange pci230_ao_range = { 2, { */ static int pci230_attach(comedi_device *dev,comedi_devconfig *it); static int pci230_detach(comedi_device *dev); -comedi_driver driver_amplc_pci230={ +static comedi_driver driver_amplc_pci230={ driver_name: "amplc_pci230", module: THIS_MODULE, attach: pci230_attach, diff --git a/comedi/drivers/cb_pcidda.c b/comedi/drivers/cb_pcidda.c index 40e9e9f4..8f3a13ea 100644 --- a/comedi/drivers/cb_pcidda.c +++ b/comedi/drivers/cb_pcidda.c @@ -94,7 +94,7 @@ #define DADATA 8 // FIRST D/A DATA REGISTER (0) -comedi_lrange cb_pcidda_ranges = +static comedi_lrange cb_pcidda_ranges = { 6, { @@ -212,7 +212,7 @@ typedef struct */ static int cb_pcidda_attach(comedi_device *dev,comedi_devconfig *it); static int cb_pcidda_detach(comedi_device *dev); -comedi_driver driver_cb_pcidda={ +static comedi_driver driver_cb_pcidda={ driver_name: "cb_pcidda", module: THIS_MODULE, attach: cb_pcidda_attach, diff --git a/comedi/drivers/dt2801.c b/comedi/drivers/dt2801.c index 11c36705..f8103f0a 100644 --- a/comedi/drivers/dt2801.c +++ b/comedi/drivers/dt2801.c @@ -70,7 +70,7 @@ static int dt2801_attach(comedi_device *dev,comedi_devconfig *it); static int dt2801_detach(comedi_device *dev); -comedi_driver driver_dt2801={ +static comedi_driver driver_dt2801={ driver_name: "dt2801", module: THIS_MODULE, attach: dt2801_attach, @@ -419,7 +419,7 @@ static int probe_number_of_ai_chans(comedi_device *dev) } -comedi_lrange *dac_range_table[]={ +static comedi_lrange *dac_range_table[]={ &range_bipolar10, &range_bipolar5, &range_bipolar2_5, @@ -427,20 +427,13 @@ comedi_lrange *dac_range_table[]={ &range_unipolar5 }; -comedi_lrange *dac_range_lkup(int opt) +static comedi_lrange *dac_range_lkup(int opt) { if(opt<0 || opt>5)return &range_unknown; return dac_range_table[opt]; } -comedi_lrange *ai_range_table[]={ - &range_dt2801_ai_pgl_bipolar, - &range_bipolar5, - &range_bipolar2_5, - &range_unipolar10, - &range_unipolar5 -}; -comedi_lrange *ai_range_lkup(int type,int opt) +static comedi_lrange *ai_range_lkup(int type,int opt) { switch(type){ case 0: diff --git a/comedi/drivers/dt2811.c b/comedi/drivers/dt2811.c index c73274e8..f9266b78 100644 --- a/comedi/drivers/dt2811.c +++ b/comedi/drivers/dt2811.c @@ -40,37 +40,37 @@ static char *driver_name = "dt2811"; -comedi_lrange range_dt2811_pgh_ai_5_unipolar = { 4, { +static comedi_lrange range_dt2811_pgh_ai_5_unipolar = { 4, { RANGE( 0, 5 ), RANGE( 0, 2.5 ), RANGE( 0, 1.25 ), RANGE( 0, 0.625 ) }}; -comedi_lrange range_dt2811_pgh_ai_2_5_bipolar = { 4, { +static comedi_lrange range_dt2811_pgh_ai_2_5_bipolar = { 4, { RANGE( -2.5, 2.5 ), RANGE( -1.25, 1.25 ), RANGE( -0.625, 0.625 ), RANGE( -0.3125, 0.3125 ) }}; -comedi_lrange range_dt2811_pgh_ai_5_bipolar = { 4, { +static comedi_lrange range_dt2811_pgh_ai_5_bipolar = { 4, { RANGE( -5, 5 ), RANGE( -2.5, 2.5 ), RANGE( -1.25, 1.25 ), RANGE( -0.625, 0.625 ) }}; -comedi_lrange range_dt2811_pgl_ai_5_unipolar = { 4, { +static comedi_lrange range_dt2811_pgl_ai_5_unipolar = { 4, { RANGE( 0, 5 ), RANGE( 0, 0.5 ), RANGE( 0, 0.05 ), RANGE( 0, 0.01 ) }}; -comedi_lrange range_dt2811_pgl_ai_2_5_bipolar = { 4, { +static comedi_lrange range_dt2811_pgl_ai_2_5_bipolar = { 4, { RANGE( -2.5, 2.5 ), RANGE( -0.25, 0.25 ), RANGE( -0.025, 0.025 ), RANGE( -0.005, 0.005 ) }}; -comedi_lrange range_dt2811_pgl_ai_5_bipolar = { 4, { +static comedi_lrange range_dt2811_pgl_ai_5_bipolar = { 4, { RANGE( -5, 5 ), RANGE( -0.5, 0.5 ), RANGE( -0.05, 0.05 ), @@ -196,7 +196,7 @@ static boardtype boardtypes[]={ static int dt2811_attach(comedi_device *dev,comedi_devconfig *it); static int dt2811_detach(comedi_device *dev); -comedi_driver driver_dt2811={ +static comedi_driver driver_dt2811={ driver_name: "dt2811", module: THIS_MODULE, attach: dt2811_attach, diff --git a/comedi/drivers/pcl711.c b/comedi/drivers/pcl711.c index 06ea6442..ae4cca1c 100644 --- a/comedi/drivers/pcl711.c +++ b/comedi/drivers/pcl711.c @@ -127,7 +127,7 @@ typedef int bool; #define PCL711_TIMEOUT 100 #define PCL711_DRDY 0x10 -int i8253_osc_base = 500; /* 2 Mhz */ +static int i8253_osc_base = 500; /* 2 Mhz */ typedef struct { char *name; @@ -153,7 +153,7 @@ static boardtype boardtypes[] = static int pcl711_attach(comedi_device *dev,comedi_devconfig *it); static int pcl711_detach(comedi_device *dev); -comedi_driver driver_pcl711={ +static comedi_driver driver_pcl711={ driver_name: "pcl711", module: THIS_MODULE, attach: pcl711_attach, diff --git a/comedi/drivers/pcl726.c b/comedi/drivers/pcl726.c index 3643ac98..34920c20 100644 --- a/comedi/drivers/pcl726.c +++ b/comedi/drivers/pcl726.c @@ -97,8 +97,8 @@ #define RANGE_mA(a,b) {(a)*1e6,(b)*1e6,UNIT_mA} -comedi_lrange range_4_20mA={ 1, {RANGE_mA(4,20)}}; -comedi_lrange range_0_20mA={ 1, {RANGE_mA(0,20)}}; +static comedi_lrange range_4_20mA={ 1, {RANGE_mA(4,20)}}; +static comedi_lrange range_0_20mA={ 1, {RANGE_mA(0,20)}}; static comedi_lrange *rangelist_726[]={ &range_unipolar5, &range_unipolar10, @@ -156,7 +156,7 @@ static boardtype boardtypes[] = #define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype)) #define this_board ((boardtype *)dev->board_ptr) -comedi_driver driver_pcl726={ +static comedi_driver driver_pcl726={ driver_name: "pcl726", module: THIS_MODULE, attach: pcl726_attach, diff --git a/comedi/drivers/pcl812.c b/comedi/drivers/pcl812.c index 19a3ba6f..37edd487 100644 --- a/comedi/drivers/pcl812.c +++ b/comedi/drivers/pcl812.c @@ -347,7 +347,7 @@ static boardtype boardtypes[] = #define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype)) #define this_board ((boardtype *)dev->board_ptr) -comedi_driver driver_pcl812={ +static comedi_driver driver_pcl812={ driver_name: "pcl812", module: THIS_MODULE, attach: pcl812_attach, @@ -397,10 +397,10 @@ typedef struct { /* ============================================================================== */ -void start_pacer(comedi_device * dev, int mode, unsigned int divisor1, unsigned int divisor2); -void setup_range_channel(comedi_device * dev, comedi_subdevice * s, +static void start_pacer(comedi_device * dev, int mode, unsigned int divisor1, unsigned int divisor2); +static void setup_range_channel(comedi_device * dev, comedi_subdevice * s, unsigned int rangechan, char wait); -int pcl812_ai_cancel(comedi_device * dev, comedi_subdevice * s); +static int pcl812_ai_cancel(comedi_device * dev, comedi_subdevice * s); /* ============================================================================== */ @@ -535,7 +535,7 @@ static int pcl812_do_insn_bits(comedi_device *dev,comedi_subdevice *s, /* ============================================================================== */ -void pcl812_cmdtest_out(int e,comedi_cmd *cmd) { +static void pcl812_cmdtest_out(int e,comedi_cmd *cmd) { rt_printk("pcl812 e=%d startsrc=%x scansrc=%x convsrc=%x\n",e,cmd->start_src,cmd->scan_begin_src,cmd->convert_src); rt_printk("pcl812 e=%d startarg=%d scanarg=%d convarg=%d\n",e,cmd->start_arg,cmd->scan_begin_arg,cmd->convert_arg); rt_printk("pcl812 e=%d stopsrc=%x scanend=%x\n",e,cmd->stop_src,cmd->scan_end_src); @@ -1041,7 +1041,7 @@ static int pcl812_ai_poll(comedi_device *dev,comedi_subdevice *s) /* ============================================================================== */ -void setup_range_channel(comedi_device * dev, comedi_subdevice * s, +static void setup_range_channel(comedi_device * dev, comedi_subdevice * s, unsigned int rangechan, char wait) { unsigned char chan_reg=CR_CHAN(rangechan); // normal board @@ -1077,7 +1077,7 @@ void setup_range_channel(comedi_device * dev, comedi_subdevice * s, /* ============================================================================== */ -void start_pacer(comedi_device * dev, int mode, unsigned int divisor1, unsigned int divisor2) +static void start_pacer(comedi_device * dev, int mode, unsigned int divisor1, unsigned int divisor2) { #ifdef PCL812_EXTDEBUG rt_printk("pcl812 EDBG: BGN: start_pacer(%d,%u,%u)\n",mode,divisor1,divisor2); @@ -1120,7 +1120,7 @@ static void free_resources(comedi_device * dev) /* ============================================================================== */ -int pcl812_ai_cancel(comedi_device * dev, comedi_subdevice * s) +static int pcl812_ai_cancel(comedi_device * dev, comedi_subdevice * s) { #ifdef PCL812_EXTDEBUG rt_printk("pcl812 EDBG: BGN: pcl812_ai_cancel(...)\n"); diff --git a/comedi/drivers/pcl818.c b/comedi/drivers/pcl818.c index f08a408c..0c8806b4 100644 --- a/comedi/drivers/pcl818.c +++ b/comedi/drivers/pcl818.c @@ -252,7 +252,7 @@ static boardtype boardtypes[] = #define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype)) -comedi_driver driver_pcl818={ +static comedi_driver driver_pcl818={ driver_name: "pcl818", module: THIS_MODULE, attach: pcl818_attach, @@ -312,12 +312,12 @@ static unsigned int muxonechan[] ={ 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x /* ============================================================================== */ -int check_and_setup_channel_list(comedi_device * dev, comedi_subdevice * s, comedi_trig * it); -int pcl818_ai_cancel(comedi_device * dev, comedi_subdevice * s); -void start_pacer(comedi_device * dev, int mode, unsigned int divisor1, unsigned int divisor2); -int set_rtc_irq_bit(unsigned char bit); -void rtc_dropped_irq(unsigned long data); -int rtc_setfreq_irq(int freq); +static int check_and_setup_channel_list(comedi_device * dev, comedi_subdevice * s, comedi_trig * it); +static int pcl818_ai_cancel(comedi_device * dev, comedi_subdevice * s); +static void start_pacer(comedi_device * dev, int mode, unsigned int divisor1, unsigned int divisor2); +static int set_rtc_irq_bit(unsigned char bit); +static void rtc_dropped_irq(unsigned long data); +static int rtc_setfreq_irq(int freq); /* ============================================================================== @@ -800,7 +800,7 @@ static void interrupt_pcl818(int irq, void *d, struct pt_regs *regs) ANALOG INPUT MODE 1 or 3 DMA , 818 cards */ #ifdef CONFIG_COMEDI_TRIG -void pcl818_ai_mode13dma_int(int mode, comedi_device * dev, comedi_subdevice * s, comedi_trig * it) +static void pcl818_ai_mode13dma_int(int mode, comedi_device * dev, comedi_subdevice * s, comedi_trig * it) { unsigned int flags; unsigned int bytes; @@ -839,7 +839,7 @@ void pcl818_ai_mode13dma_int(int mode, comedi_device * dev, comedi_subdevice * s ANALOG INPUT MODE 1 or 3 DMA rtc, 818 cards */ #ifdef CONFIG_COMEDI_TRIG -void pcl818_ai_mode13dma_rtc(int mode, comedi_device * dev, comedi_subdevice * s, comedi_trig * it) +static void pcl818_ai_mode13dma_rtc(int mode, comedi_device * dev, comedi_subdevice * s, comedi_trig * it) { unsigned int flags; sampl_t *pole; @@ -1065,7 +1065,7 @@ static int pcl818_ao_mode3(comedi_device * dev, comedi_subdevice * s, comedi_tri ============================================================================== Start/stop pacer onboard pacer */ -void start_pacer(comedi_device * dev, int mode, unsigned int divisor1, unsigned int divisor2) +static void start_pacer(comedi_device * dev, int mode, unsigned int divisor1, unsigned int divisor2) { outb(0xb4, dev->iobase + PCL818_CTRCTL); outb(0x74, dev->iobase + PCL818_CTRCTL); @@ -1085,7 +1085,7 @@ void start_pacer(comedi_device * dev, int mode, unsigned int divisor1, unsigned Check if channel list from user is builded correctly If it's ok, then program scan/gain logic */ -int check_and_setup_channel_list(comedi_device * dev, comedi_subdevice * s, comedi_trig * it) +static int check_and_setup_channel_list(comedi_device * dev, comedi_subdevice * s, comedi_trig * it) { unsigned int chansegment[16]; unsigned int i, nowmustbechan, seglen, segpos; @@ -1158,7 +1158,7 @@ int check_and_setup_channel_list(comedi_device * dev, comedi_subdevice * s, come ============================================================================== Check if board is switched to SE (1) or DIFF(0) mode */ -int check_single_ended(unsigned int port) +static int check_single_ended(unsigned int port) { if (inb(port+PCL818_STATUS)&0x20) { return 1; } else { return 0; } @@ -1168,7 +1168,7 @@ int check_single_ended(unsigned int port) ============================================================================== cancel any mode 1-4 AI */ -int pcl818_ai_cancel(comedi_device * dev, comedi_subdevice * s) +static int pcl818_ai_cancel(comedi_device * dev, comedi_subdevice * s) { if (devpriv->irq_blocked>0) { // rt_printk("pcl818_ai_cancel()\n"); @@ -1219,7 +1219,7 @@ int pcl818_ai_cancel(comedi_device * dev, comedi_subdevice * s) ============================================================================== chech for PCL818 */ -int pcl818_check(int iobase) +static int pcl818_check(int iobase) { outb(0x00, iobase + PCL818_MUX); udelay(1); @@ -1239,7 +1239,7 @@ int pcl818_check(int iobase) ============================================================================== reset whole PCL-818 cards */ -void pcl818_reset(comedi_device * dev) +static void pcl818_reset(comedi_device * dev) { if (devpriv->usefifo) { // FIFO shutdown outb(0, dev->iobase + PCL818_FI_INTCLR); @@ -1271,7 +1271,7 @@ void pcl818_reset(comedi_device * dev) ============================================================================== Enable(1)/disable(0) periodic interrupts from RTC */ -int set_rtc_irq_bit(unsigned char bit) +static int set_rtc_irq_bit(unsigned char bit) { unsigned char val; unsigned long flags; @@ -1300,7 +1300,7 @@ int set_rtc_irq_bit(unsigned char bit) ============================================================================== Restart RTC if something stop it (xntpd every 11 mins or large IDE transfers) */ -void rtc_dropped_irq(unsigned long data) +static void rtc_dropped_irq(unsigned long data) { comedi_device *dev = (void *)data; unsigned long flags,tmp; @@ -1322,7 +1322,7 @@ void rtc_dropped_irq(unsigned long data) ============================================================================== Set frequency of interrupts from RTC */ -int rtc_setfreq_irq(int freq) +static int rtc_setfreq_irq(int freq) { int tmp = 0; int rtc_freq; diff --git a/comedi/drivers/pcmad.c b/comedi/drivers/pcmad.c index 0e9dfd5a..9b785184 100644 --- a/comedi/drivers/pcmad.c +++ b/comedi/drivers/pcmad.c @@ -48,7 +48,7 @@ struct pcmad_board_struct{ char *name; int n_ai_bits; }; -struct pcmad_board_struct pcmad_boards[]={ +static struct pcmad_board_struct pcmad_boards[]={ { name: "pcmad12", n_ai_bits: 12, @@ -69,7 +69,7 @@ struct pcmad_priv_struct{ static int pcmad_attach(comedi_device *dev,comedi_devconfig *it); static int pcmad_detach(comedi_device *dev); -comedi_driver driver_pcmad={ +static comedi_driver driver_pcmad={ driver_name: "pcmad", module: THIS_MODULE, attach: pcmad_attach, diff --git a/comedi/drivers/rtd520.c b/comedi/drivers/rtd520.c index f620249f..c0b5bc28 100644 --- a/comedi/drivers/rtd520.c +++ b/comedi/drivers/rtd520.c @@ -182,7 +182,7 @@ typedef struct rtdBoard_struct{ int fifoLen; } rtdBoard; -rtdBoard rtd520Boards[] = { +static rtdBoard rtd520Boards[] = { { name: "DM7520", device_id: 0x7520, @@ -499,33 +499,14 @@ typedef struct{ static int rtd_attach (comedi_device *dev, comedi_devconfig *it); static int rtd_detach (comedi_device *dev); -comedi_driver rtd520Driver={ +static comedi_driver rtd520Driver={ driver_name: "rtd520", module: THIS_MODULE, attach: rtd_attach, detach: rtd_detach, - - /* It is not necessary to implement the following members if you are - * writing a driver for a ISA PnP or PCI card */ - /* Most drivers will support multiple types of boards by - * having an array of board structures. These were defined - * in rtd520Boards[] above. Note that the element 'name' - * was first in the structure -- Comedi uses this fact to - * extract the name of the board without knowing any details - * about the structure except for its length. - * When a device is attached (by comedi_config), the name - * of the device is given to Comedi, and Comedi tries to - * match it by going through the list of board names. If - * there is a match, the address of the pointer is put - * into dev->board_ptr and driver->attach() is called. - * - * Note that these are not necessary if you can determine - * the type of board in software. ISA PnP, PCI, and PCMCIA - * devices are such boards. - */ - board_name: rtd520Boards, + board_name: rtd520Boards, offset: sizeof(rtdBoard), - num_names: sizeof(rtd520Boards) / sizeof(rtdBoard), + num_names: sizeof(rtd520Boards) / sizeof(rtdBoard), }; static int rtd_ai_rinsn (comedi_device *dev, comedi_subdevice *s, diff --git a/comedi/drivers/skel.c b/comedi/drivers/skel.c index b525566d..b8c5f1ae 100644 --- a/comedi/drivers/skel.c +++ b/comedi/drivers/skel.c @@ -54,7 +54,7 @@ typedef struct skel_board_struct{ int ai_bits; int have_dio; }skel_board; -skel_board skel_boards[] = { +static skel_board skel_boards[] = { { name: "skel-100", ai_chans: 16, @@ -99,7 +99,7 @@ typedef struct{ */ static int skel_attach(comedi_device *dev,comedi_devconfig *it); static int skel_detach(comedi_device *dev); -comedi_driver driver_skel={ +static comedi_driver driver_skel={ driver_name: "dummy", module: THIS_MODULE, attach: skel_attach, -- 2.26.2