]> git.karo-electronics.de Git - linux-beck.git/commit
staging: comedi: use refcount in comedi_driver_unregister()
authorIan Abbott <abbotti@mev.co.uk>
Fri, 8 Nov 2013 15:03:35 +0000 (15:03 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Nov 2013 00:16:44 +0000 (16:16 -0800)
commita200fadca97abb337dcc28e737c1a2e11f56b714
treeca6b867d2e033b9662562faa474a4c899177c0c7
parentfc406986d4115dfbd5e2ea8a0e96920e97162689
staging: comedi: use refcount in comedi_driver_unregister()

Change `comedi_driver_unregister()` to call
`comedi_dev_get_from_minor()` instead of `comedi_dev_from_minor()` when
finding devices using the driver.  This increments the reference count
to prevent the device being removed while it is being checked to see if
it is attached to the driver.  Call `comedi_dev_put()` to decrement the
reference afterwards.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers.c