diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2013-04-04 13:59:13 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-05 21:33:21 (GMT) |
commit | 0fcc9d48a0e620ee5097cbcbf8aedc5d736a01b8 (patch) | |
tree | ec3b3b44e4a6353ac02e0995f6353d5c41eac07b /drivers/staging/comedi/comedi_fops.c | |
parent | f3abc831386e3606fbb21acf0ee5231df0d0185f (diff) | |
download | linux-fsl-qoriq-0fcc9d48a0e620ee5097cbcbf8aedc5d736a01b8.tar.xz |
staging: comedi: remove comedi_clear_subdevice_minor()
Merge the code from `comedi_clear_subdevice_minor()` into
`comedi_free_subdevice_minor()` and remove it since nothing else calls
it.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedi_fops.c')
-rw-r--r-- | drivers/staging/comedi/comedi_fops.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 5f3b152..64721f7 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -137,18 +137,6 @@ static struct comedi_file_info *comedi_clear_board_minor(unsigned minor) return info; } -static struct comedi_file_info *comedi_clear_subdevice_minor(unsigned minor) -{ - struct comedi_file_info *info; - unsigned int i = minor - COMEDI_NUM_BOARD_MINORS; - - mutex_lock(&comedi_subdevice_minor_table_lock); - info = comedi_subdevice_minor_table[i]; - comedi_subdevice_minor_table[i] = NULL; - mutex_unlock(&comedi_subdevice_minor_table_lock); - return info; -} - static void comedi_free_board_file_info(struct comedi_file_info *info) { if (info) { @@ -2528,6 +2516,7 @@ int comedi_alloc_subdevice_minor(struct comedi_subdevice *s) void comedi_free_subdevice_minor(struct comedi_subdevice *s) { struct comedi_file_info *info; + unsigned int i; if (s == NULL) return; @@ -2537,7 +2526,11 @@ void comedi_free_subdevice_minor(struct comedi_subdevice *s) BUG_ON(s->minor >= COMEDI_NUM_MINORS); BUG_ON(s->minor < COMEDI_NUM_BOARD_MINORS); - info = comedi_clear_subdevice_minor(s->minor); + i = s->minor - COMEDI_NUM_BOARD_MINORS; + mutex_lock(&comedi_subdevice_minor_table_lock); + info = comedi_subdevice_minor_table[i]; + comedi_subdevice_minor_table[i] = NULL; + mutex_unlock(&comedi_subdevice_minor_table_lock); if (s->class_dev) { device_destroy(comedi_class, MKDEV(COMEDI_MAJOR, s->minor)); s->class_dev = NULL; |