diff options
author | Ian Abbott | 2013-04-04 15:58:53 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2013-04-05 23:33:18 +0200 |
commit | 1f423cfcf56052b462c4bceefb950921c9a0f495 (patch) | |
tree | ca0e79b1ed79355a149ef46606a097e8e5b03dac /drivers | |
parent | staging: comedi: avoid releasing legacy minors automatically (diff) | |
download | kernel-qcow2-linux-1f423cfcf56052b462c4bceefb950921c9a0f495.tar.gz kernel-qcow2-linux-1f423cfcf56052b462c4bceefb950921c9a0f495.tar.xz kernel-qcow2-linux-1f423cfcf56052b462c4bceefb950921c9a0f495.zip |
staging: comedi: no need to evade comedi_auto_unconfig()
When `comedi_unlocked_ioctl()` handled the `COMEDI_DEVCONFIG` ioctl via
a call to `do_devconfig()`, this used to be allowed to attach a legacy
hardware device to any board minor device, and the auto-unconfiguration
code for non-legacy used to search all board minor devices to find the
hardware device being removed. After calling `do_devconfig()`
successfully, `comedi_unlocked_ioctl()` sets the `hardware_device`
member of the `struct comedi_file_info` to NULL to stop the
auto-unconfiguration code finding it by accident and unconfiguring the
wrong comedi device as a result.
The above is no longer necessary because `do_devconfig()` now only
allows legacy hardware devices to be attached to comedi board minor
device numbers below `comedi_num_legacy_minors` and the
auto-unconfiguration code (particularly
`comedi_release_hardware_device()`) only searches comedi board minor
device numbers greater than or equal to `comedi_num_legacy_minors`, so
there is no overlap.
Remove the now unnecessary setting of `info->hardware_device = NULL` in
`comedi_unlocked_ioctl()`.
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 'drivers')
-rw-r--r-- | drivers/staging/comedi/comedi_fops.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index ffa64228c3cf..a155bf2c6592 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -1635,9 +1635,6 @@ static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd, } rc = do_devconfig_ioctl(dev, (struct comedi_devconfig __user *)arg); - if (rc == 0) - /* Evade comedi_auto_unconfig(). */ - info->hardware_device = NULL; goto done; } |