Commit 43db062a authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: add 'pacer' member to struct comedi_device

Add a new member to the comedi_device struct for a comedi_8254 'pacer'. This
provides a convient place to store the data allocated by the comedi_8254 module
for boards that use an 8254 device to create the data acquisition pacer clock.

Automatically free this pointer in comedi_device_detach_cleanup() so that the
drivers don't need to do it when then are detached.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d42b5211
...@@ -256,6 +256,7 @@ struct comedi_driver { ...@@ -256,6 +256,7 @@ struct comedi_driver {
struct comedi_device { struct comedi_device {
int use_count; int use_count;
struct comedi_driver *driver; struct comedi_driver *driver;
struct comedi_8254 *pacer;
void *private; void *private;
struct device *class_dev; struct device *class_dev;
......
...@@ -139,7 +139,9 @@ static void comedi_device_detach_cleanup(struct comedi_device *dev) ...@@ -139,7 +139,9 @@ static void comedi_device_detach_cleanup(struct comedi_device *dev)
dev->n_subdevices = 0; dev->n_subdevices = 0;
} }
kfree(dev->private); kfree(dev->private);
kfree(dev->pacer);
dev->private = NULL; dev->private = NULL;
dev->pacer = NULL;
dev->driver = NULL; dev->driver = NULL;
dev->board_name = NULL; dev->board_name = NULL;
dev->board_ptr = NULL; dev->board_ptr = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment