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

Skip to content
Commit ba1bcf6f authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman
Browse files

staging: comedi: (core): add comedi_dev_from_file_info()



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: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a679f361
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment