summaryrefslogtreecommitdiffstats
path: root/scripts/export_report.pl
diff options
context:
space:
mode:
authorIan Abbott2013-04-04 15:58:56 +0200
committerGreg Kroah-Hartman2013-04-05 23:33:18 +0200
commitb2a644b435de1d45bd8b5d4e391c894a662eb1f3 (patch)
tree1ef1cdb7384a52025bc8c9ed2c643c493b7ad582 /scripts/export_report.pl
parentstaging: comedi: avoid forward declarations (diff)
downloadkernel-qcow2-linux-b2a644b435de1d45bd8b5d4e391c894a662eb1f3.tar.gz
kernel-qcow2-linux-b2a644b435de1d45bd8b5d4e391c894a662eb1f3.tar.xz
kernel-qcow2-linux-b2a644b435de1d45bd8b5d4e391c894a662eb1f3.zip
staging: comedi: simplify driver module counting
For a legacy device attachment with the `COMEDI_DEVCONFIG` ioctl, `do_devconfig_ioctl()` calls `comedi_device_attach()` to find a matching device driver and attach the device. It then tries to increment the device driver's module count and if that fails it detaches the device. So on successful attachment of a device by the `COMEDI_DEVCONFIG` ioctl, the device driver's module count will have been incremented. `comedi_device_attach()` is called from nowhere else. It already increments the device driver's module count temporarily and decrements it again; if it gets as far as calling `comedi_device_postconfig()` the module count is decremented within that function. Simplify the above by removing the decrement of the device driver module count from `comedi_device_postconfig()`. If the call to `comedi_device_postconfig()` succeeds, `comedi_device_attach()` will return with the module count still incremented, otherwise decrement the module count before returning the error. Don't try and increment the module count in `do_devconfig_ioctl()` after a successful return from `comedi_device_attach()` as the module count has now already been incremented. `comedi_device_postconfig()` is also called by `comedi_auto_config()` which currently has to increment the device driver's module count temporarily so that `comedi_device_postconfig()` can decrement it, but always returns with no overall change to the module count. Remove all the module count manipulations from `comedi_device_postconfig()`. There is no other reason for `comedi_auto_config()` to increment the device driver's module count temporarily, since it is only called (indirectly) from the device driver itself (usually via one of the wrappers `comedi_pci_auto_config()` or `comedi_usb_auto_config()`). 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>
Diffstat (limited to 'scripts/export_report.pl')
0 files changed, 0 insertions, 0 deletions