diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2013-04-04 17:59:06 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-06 01:33:20 +0400 |
commit | 0918e595ae45d99e0bd8a9950a0f0cb0e2a9c948 (patch) | |
tree | d85248832d8edc9b2a77e9dea4f400792c2ed945 /drivers/staging/comedi/comedi_fops.c | |
parent | ea1cc3973a6f3832956d99f74b20970a4e71bd37 (diff) | |
download | linux-0918e595ae45d99e0bd8a9950a0f0cb0e2a9c948.tar.xz |
staging: comedi: remove hardware_device from struct comedi_device_info
The `hardware_device` member of `struct comedi_device_info` is only set
to point to a hardware device by the auto-configuration code (specifically
`comedi_alloc_board_minor() with a non-NULL `hardware_device` parameter)
so that it can be found again by the auto-unconfiguration code
(specifically `comedi_release_hardware_device()`). However, as
`info->device->hw_dev` (where `info` is a pointer to the `struct
comedi_device_info`) is set to the same value as `info->hardware_device`
(by calling `comedi_set_hw_dev()` with the same hardware device pointer)
we can look for that instead, so there is no need for the
`hardware_device` member any more. Get rid of it.
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/staging/comedi/comedi_fops.c')
-rw-r--r-- | drivers/staging/comedi/comedi_fops.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 00481357a7b8..b73d8066cd15 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -85,7 +85,6 @@ struct comedi_file_info { struct comedi_device *device; struct comedi_subdevice *read_subdevice; struct comedi_subdevice *write_subdevice; - struct device *hardware_device; }; static DEFINE_MUTEX(comedi_board_minor_table_lock); @@ -2368,7 +2367,6 @@ struct comedi_device *comedi_alloc_board_minor(struct device *hardware_device) return ERR_PTR(-ENOMEM); } info->device = dev; - info->hardware_device = hardware_device; comedi_device_init(dev); comedi_set_hw_dev(dev, hardware_device); mutex_lock(&dev->mutex); @@ -2415,7 +2413,7 @@ void comedi_release_hardware_device(struct device *hardware_device) minor++) { mutex_lock(&comedi_board_minor_table_lock); info = comedi_board_minor_table[minor]; - if (info && info->hardware_device == hardware_device) { + if (info && info->device->hw_dev == hardware_device) { comedi_board_minor_table[minor] = NULL; mutex_unlock(&comedi_board_minor_table_lock); comedi_free_board_file_info(info); |