Setting `info = comedi_file_info_from_minor(minor)` and `dev =
comedi_dev_from_minor(minor)` in the same function is a bit of a waste.
The latter function is just a call of the former followed by a
conditional return of an embedded pointer (`info->device`) or NULL. The
former function uses a spin-lock which is where the wastfulness comes
in.
Move the "followed by a conditional return of an embedded pointer" part
into a new function `comedi_dev_from_file_info` and call this instead of
`comedi_dev_from_minor()` in the places where
`comedi_file_info_from_minor()` is also called.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>