Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74120719 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: comedi_fops: move comedi_get_subdevice_runflags()



For aesthetic reasons, move this function so its near
comedi_set_subdevice_runflags().

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bc252fd1
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -363,6 +363,18 @@ static void comedi_set_subdevice_runflags(struct comedi_subdevice *s,
	spin_unlock_irqrestore(&s->spin_lock, flags);
}

unsigned comedi_get_subdevice_runflags(struct comedi_subdevice *s)
{
	unsigned long flags;
	unsigned runflags;

	spin_lock_irqsave(&s->spin_lock, flags);
	runflags = s->runflags;
	spin_unlock_irqrestore(&s->spin_lock, flags);
	return runflags;
}
EXPORT_SYMBOL(comedi_get_subdevice_runflags);

/*
   This function restores a subdevice to an idle state.
 */
@@ -2242,18 +2254,6 @@ void comedi_event(struct comedi_device *dev, struct comedi_subdevice *s)
}
EXPORT_SYMBOL(comedi_event);

unsigned comedi_get_subdevice_runflags(struct comedi_subdevice *s)
{
	unsigned long flags;
	unsigned runflags;

	spin_lock_irqsave(&s->spin_lock, flags);
	runflags = s->runflags;
	spin_unlock_irqrestore(&s->spin_lock, flags);
	return runflags;
}
EXPORT_SYMBOL(comedi_get_subdevice_runflags);

static void comedi_device_init(struct comedi_device *dev)
{
	memset(dev, 0, sizeof(*dev));