From: Ian Abbott Date: Tue, 29 Jan 2013 16:20:17 +0000 (+0000) Subject: staging: comedi: simplify comedi_set_hw_dev() X-Git-Tag: v3.9-rc1~127^2~238 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc3954b8147402e4495378d982cc8e708703a0f1;p=pandora-kernel.git staging: comedi: simplify comedi_set_hw_dev() Since `get_device()` and `put_device()` can take a NULL device parameter, `comedi_set_hw_dev()` can be simplified to always call `get_device()` for the new, possibly NULL hardware device, and `put_device()` for the old, possibly NULL hardware device. As long as we do it in that order, there shouldn't be any problem with `kref_release()` getting called unexpectedly when the new hardware device is the old hardware device. Simplify `comedi_set_hw_dev()` and update the comment because the function is used for additional purposes since the old comment was written. Signed-off-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed