From: Ian Abbott Date: Tue, 8 Jan 2013 13:27:48 +0000 (+0000) Subject: staging: comedi: (core): add comedi_dev_from_file_info() X-Git-Tag: v3.9-rc1~127^2~444 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba1bcf6f23e192e88b7c07d20d6221a0bcb7929e;p=pandora-kernel.git 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: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed