]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: pre-lock mutex on creation of comedi device
authorIan Abbott <abbotti@mev.co.uk>
Thu, 4 Apr 2013 13:58:51 +0000 (14:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Apr 2013 21:33:17 +0000 (14:33 -0700)
commite55863c21a8c7dde8ff7c4ce190f87f962d785e1
tree85dfeee58a70d808b837a30e5112ccdaa7fe2b82
parent38f56ef99dd2d9fbc7f09a43db1cda78b3ab3c95
staging: comedi: pre-lock mutex on creation of comedi device

Return from `comedi_alloc_board_minor()` with the mutex of the created
`struct comedi_device` pre-locked.  This allows further initialization
by the caller without the worry of something getting in there first.

`comedi_auto_config()` no longer needs to check if the device is already
"attached" since whatever was trying to attach the device would need to
have locked the mutex first.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/comedi_fops.c
drivers/staging/comedi/drivers.c