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: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct comedi_device {
int use_count;
struct comedi_driver *driver;
+ struct comedi_8254 *pacer;
void *private;
struct device *class_dev;
dev->n_subdevices = 0;
}
kfree(dev->private);
+ kfree(dev->pacer);
dev->private = NULL;
+ dev->pacer = NULL;
dev->driver = NULL;
dev->board_name = NULL;
dev->board_ptr = NULL;