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: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
c4237a2b59
Коммит
2be8ae5898
|
@ -2774,12 +2774,6 @@ struct comedi_device *comedi_alloc_board_minor(struct device *hardware_device)
|
|||
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)
|
||||
{
|
||||
int minor;
|
||||
|
@ -2852,10 +2846,13 @@ void comedi_free_subdevice_minor(struct comedi_subdevice *s)
|
|||
|
||||
static void comedi_cleanup_board_minors(void)
|
||||
{
|
||||
struct comedi_device *dev;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < COMEDI_NUM_BOARD_MINORS; i++)
|
||||
comedi_free_board_minor(i);
|
||||
for (i = 0; i < COMEDI_NUM_BOARD_MINORS; i++) {
|
||||
dev = comedi_clear_board_minor(i);
|
||||
comedi_free_board_dev(dev);
|
||||
}
|
||||
}
|
||||
|
||||
static int __init comedi_init(void)
|
||||
|
|
Загрузка…
Ссылка в новой задаче