Commit 2be8ae58 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: comedi_fops: absorb comedi_free_board_minor()

This function is only called by comedi_cleanup_board_minors() and the
'minor' parameter will always be < COMEDI_NUM_BOARD_MINORS.

For aesthetics, absorb the function and remove the unnecessary BUG_ON().

Split the comedi_clear_board_minor() out to clarify that the return value
is a comedi_device pointer.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c4237a2b
...@@ -2774,12 +2774,6 @@ struct comedi_device *comedi_alloc_board_minor(struct device *hardware_device) ...@@ -2774,12 +2774,6 @@ struct comedi_device *comedi_alloc_board_minor(struct device *hardware_device)
return dev; return dev;
} }
static void comedi_free_board_minor(unsigned minor)
{
BUG_ON(minor >= COMEDI_NUM_BOARD_MINORS);
comedi_free_board_dev(comedi_clear_board_minor(minor));
}
void comedi_release_hardware_device(struct device *hardware_device) void comedi_release_hardware_device(struct device *hardware_device)
{ {
int minor; int minor;
...@@ -2852,10 +2846,13 @@ void comedi_free_subdevice_minor(struct comedi_subdevice *s) ...@@ -2852,10 +2846,13 @@ void comedi_free_subdevice_minor(struct comedi_subdevice *s)
static void comedi_cleanup_board_minors(void) static void comedi_cleanup_board_minors(void)
{ {
struct comedi_device *dev;
unsigned i; unsigned i;
for (i = 0; i < COMEDI_NUM_BOARD_MINORS; i++) for (i = 0; i < COMEDI_NUM_BOARD_MINORS; i++) {
comedi_free_board_minor(i); dev = comedi_clear_board_minor(i);
comedi_free_board_dev(dev);
}
} }
static int __init comedi_init(void) static int __init comedi_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment