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) {
void comedi_free_subdevice_minor(struct comedi_subdevice *s)
{
struct comedi_file_info *info;
+ unsigned int i;
if (s == NULL)
return;
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;