From: Greg Kroah-Hartman Date: Sat, 1 May 2010 20:08:06 +0000 (-0700) Subject: Staging: comedi: kcomedilib: remove ksyms.c file X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=7382e5711f3adc934227473f82156ae1e2d7e562;p=openwrt%2Fstaging%2Fblogic.git Staging: comedi: kcomedilib: remove ksyms.c file Move only the exports that we actually use into the individual files, and delete the ksyms.c file entirely. This will make it easier to start cleaning up kcomedilib (i.e. delete most of it.) Cc: Ian Abbott Cc: Frank Mori Hess Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/kcomedilib/Makefile b/drivers/staging/comedi/kcomedilib/Makefile index ffcc9ad32adb..76de45bd37e5 100644 --- a/drivers/staging/comedi/kcomedilib/Makefile +++ b/drivers/staging/comedi/kcomedilib/Makefile @@ -2,7 +2,6 @@ obj-$(CONFIG_COMEDI) += kcomedilib.o kcomedilib-objs := \ data.o \ - ksyms.o \ dio.o \ kcomedilib_main.o \ get.o diff --git a/drivers/staging/comedi/kcomedilib/dio.c b/drivers/staging/comedi/kcomedilib/dio.c index 30192f3c4652..e37aa5308141 100644 --- a/drivers/staging/comedi/kcomedilib/dio.c +++ b/drivers/staging/comedi/kcomedilib/dio.c @@ -25,6 +25,7 @@ #include "../comedilib.h" #include +#include int comedi_dio_config(void *dev, unsigned int subdev, unsigned int chan, unsigned int io) @@ -40,6 +41,7 @@ int comedi_dio_config(void *dev, unsigned int subdev, unsigned int chan, return comedi_do_insn(dev, &insn); } +EXPORT_SYMBOL(comedi_dio_config); int comedi_dio_read(void *dev, unsigned int subdev, unsigned int chan, unsigned int *val) @@ -93,3 +95,4 @@ int comedi_dio_bitfield(void *dev, unsigned int subdev, unsigned int mask, return ret; } +EXPORT_SYMBOL(comedi_dio_bitfield); diff --git a/drivers/staging/comedi/kcomedilib/get.c b/drivers/staging/comedi/kcomedilib/get.c index 6d8418715253..ec072ce7cd4f 100644 --- a/drivers/staging/comedi/kcomedilib/get.c +++ b/drivers/staging/comedi/kcomedilib/get.c @@ -81,6 +81,7 @@ int comedi_find_subdevice_by_type(void *d, int type, unsigned int subd) } return -1; } +EXPORT_SYMBOL(comedi_find_subdevice_by_type); int comedi_get_n_channels(void *d, unsigned int subdevice) { @@ -89,6 +90,7 @@ int comedi_get_n_channels(void *d, unsigned int subdevice) return s->n_chan; } +EXPORT_SYMBOL(comedi_get_n_channels); int comedi_get_len_chanlist(void *d, unsigned int subdevice) { @@ -117,11 +119,10 @@ int comedi_get_rangetype(void *d, unsigned int subdevice, unsigned int chan) struct comedi_subdevice *s = dev->subdevices + subdevice; int ret; - if (s->range_table_list) { + if (s->range_table_list) ret = s->range_table_list[chan]->length; - } else { + else ret = s->range_table->length; - } ret = ret | (dev->minor << 28) | (subdevice << 24) | (chan << 16); @@ -135,11 +136,10 @@ int comedi_get_n_ranges(void *d, unsigned int subdevice, unsigned int chan) struct comedi_subdevice *s = dev->subdevices + subdevice; int ret; - if (s->range_table_list) { + if (s->range_table_list) ret = s->range_table_list[chan]->length; - } else { + else ret = s->range_table->length; - } return ret; } @@ -154,11 +154,11 @@ int comedi_get_krange(void *d, unsigned int subdevice, unsigned int chan, struct comedi_subdevice *s = dev->subdevices + subdevice; const struct comedi_lrange *lr; - if (s->range_table_list) { + if (s->range_table_list) lr = s->range_table_list[chan]; - } else { + else lr = s->range_table; - } + if (range >= lr->length) return -EINVAL; diff --git a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c b/drivers/staging/comedi/kcomedilib/kcomedilib_main.c index 2229b46e849c..32c7bbb8d78a 100644 --- a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c +++ b/drivers/staging/comedi/kcomedilib/kcomedilib_main.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include "../comedi.h" #include "../comedilib.h" @@ -68,6 +68,7 @@ void *comedi_open(const char *filename) return (void *)dev; } +EXPORT_SYMBOL(comedi_open); void *comedi_open_old(unsigned int minor) { @@ -96,6 +97,7 @@ int comedi_close(void *d) return 0; } +EXPORT_SYMBOL(comedi_close); int comedi_loglevel(int newlevel) { @@ -104,7 +106,7 @@ int comedi_loglevel(int newlevel) void comedi_perror(const char *message) { - printk("%s: unknown error\n", message); + printk(KERN_ERR "%s: unknown error\n", message); } char *comedi_strerror(int err) diff --git a/drivers/staging/comedi/kcomedilib/ksyms.c b/drivers/staging/comedi/kcomedilib/ksyms.c deleted file mode 100644 index 8bf4471ce6c1..000000000000 --- a/drivers/staging/comedi/kcomedilib/ksyms.c +++ /dev/null @@ -1,146 +0,0 @@ -/* - comedi/kcomedilib/ksyms.c - a comedlib interface for kernel modules - - COMEDI - Linux Control and Measurement Device Interface - Copyright (C) 1997-2001 David A. Schleef - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include "../comedi.h" -#include "../comedilib.h" -#include "../comedidev.h" - -#include - -#include -#include -#include -#include -#include -#include -#include - -/* functions specific to kcomedilib */ - -EXPORT_SYMBOL(comedi_register_callback); -EXPORT_SYMBOL(comedi_get_krange); -EXPORT_SYMBOL(comedi_get_buf_head_pos); -EXPORT_SYMBOL(comedi_set_user_int_count); -EXPORT_SYMBOL(comedi_map); -EXPORT_SYMBOL(comedi_unmap); - -/* This list comes from user-space comedilib, to show which - * functions are not ported yet. */ - -EXPORT_SYMBOL(comedi_open); -EXPORT_SYMBOL(comedi_close); - -/* logging */ -EXPORT_SYMBOL(comedi_loglevel); -EXPORT_SYMBOL(comedi_perror); -EXPORT_SYMBOL(comedi_strerror); -/* EXPORT_SYMBOL(comedi_errno); */ -EXPORT_SYMBOL(comedi_fileno); - -/* device queries */ -EXPORT_SYMBOL(comedi_get_n_subdevices); -EXPORT_SYMBOL(comedi_get_version_code); -EXPORT_SYMBOL(comedi_get_driver_name); -EXPORT_SYMBOL(comedi_get_board_name); - -/* subdevice queries */ -EXPORT_SYMBOL(comedi_get_subdevice_type); -EXPORT_SYMBOL(comedi_find_subdevice_by_type); -EXPORT_SYMBOL(comedi_get_subdevice_flags); -EXPORT_SYMBOL(comedi_get_n_channels); -/* -* EXPORT_SYMBOL(comedi_range_is_chan_specific); -* EXPORT_SYMBOL(comedi_maxdata_is_chan_specific); -*/ - -/* channel queries */ -EXPORT_SYMBOL(comedi_get_maxdata); -#ifdef KCOMEDILIB_DEPRECATED -EXPORT_SYMBOL(comedi_get_rangetype); -#endif -EXPORT_SYMBOL(comedi_get_n_ranges); -/* EXPORT_SYMBOL(comedi_find_range); */ - -/* buffer queries */ -EXPORT_SYMBOL(comedi_get_buffer_size); -/* -* EXPORT_SYMBOL(comedi_get_max_buffer_size); -* EXPORT_SYMBOL(comedi_set_buffer_size); -*/ -EXPORT_SYMBOL(comedi_get_buffer_contents); -EXPORT_SYMBOL(comedi_get_buffer_offset); - -/* low-level stuff */ -/* -* EXPORT_SYMBOL(comedi_trigger); EXPORT_SYMBOL(comedi_do_insnlist); -*/ -EXPORT_SYMBOL(comedi_do_insn); -EXPORT_SYMBOL(comedi_lock); -EXPORT_SYMBOL(comedi_unlock); - -/* physical units */ -/* -* EXPORT_SYMBOL(comedi_to_phys); EXPORT_SYMBOL(comedi_from_phys); -*/ - -/* synchronous stuff */ -EXPORT_SYMBOL(comedi_data_read); -EXPORT_SYMBOL(comedi_data_read_hint); -EXPORT_SYMBOL(comedi_data_read_delayed); -EXPORT_SYMBOL(comedi_data_write); -EXPORT_SYMBOL(comedi_dio_config); -EXPORT_SYMBOL(comedi_dio_read); -EXPORT_SYMBOL(comedi_dio_write); -EXPORT_SYMBOL(comedi_dio_bitfield); - -/* slowly varying stuff */ -/* -* EXPORT_SYMBOL(comedi_sv_init); EXPORT_SYMBOL(comedi_sv_update); -* EXPORT_SYMBOL(comedi_sv_measure); -*/ - -/* commands */ -/* -* EXPORT_SYMBOL(comedi_get_cmd_src_mask); -* EXPORT_SYMBOL(comedi_get_cmd_generic_timed); -*/ -EXPORT_SYMBOL(comedi_cancel); -EXPORT_SYMBOL(comedi_command); -EXPORT_SYMBOL(comedi_command_test); -EXPORT_SYMBOL(comedi_poll); - -/* buffer configuration */ -EXPORT_SYMBOL(comedi_mark_buffer_read); -EXPORT_SYMBOL(comedi_mark_buffer_written); - -/* EXPORT_SYMBOL(comedi_get_range); */ -EXPORT_SYMBOL(comedi_get_len_chanlist); - -/* deprecated */ -/* -* EXPORT_SYMBOL(comedi_get_timer); -* EXPORT_SYMBOL(comedi_timed_1chan); -*/ - -/* alpha */ -/* EXPORT_SYMBOL(comedi_set_global_oor_behavior); */