diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2015-04-21 13:18:10 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-04-30 17:15:59 +0200 |
commit | 8fc369ae38ff281d38e9ea11805a5cae862989bc (patch) | |
tree | 3677462a15709e6d62632df9cbf804c890c5c309 /drivers/staging/comedi/comedidev.h | |
parent | staging: comedi: serial2002: fix Coverity "Explicit null dereference" (diff) | |
download | linux-8fc369ae38ff281d38e9ea11805a5cae862989bc.tar.gz linux-8fc369ae38ff281d38e9ea11805a5cae862989bc.tar.bz2 linux-8fc369ae38ff281d38e9ea11805a5cae862989bc.zip |
staging: comedi: wrap COMEDI_SRF_FREE_SPRIV usage
The `COMEDI_SRF_FREE_SPRIV` flag in the `runflags` member of `struct
comedi_subdevice` indicates that the memory pointed to by the `private`
member can be automatically freed by the comedi core on subdevice
clean-up (when the low-level comedi device is being "detached"). the
flag doesn't really belong in `runflags`, but it was somewhere
convenient to keep it without having to add a new member to the
structure.
Rather than access the `COMEDI_SRF_FREE_SPRIV` flag directly, use some
new wrapper functions:
* comedi_can_auto_free_spriv(s) - checks whether the subdevice's
`s->private` points to memory that can be freed automatically.
* comedi_set_spriv_auto_free(s) - marks the subdevice as having a
`s->private` that points to memory that can be freed automatically.
Export `comedi_set_spriv_auto_free()` for use by the low-level comedi
driver modules, in particular the "amplc_dio200_common" module.
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/comedidev.h')
-rw-r--r-- | drivers/staging/comedi/comedidev.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h index dfab5a84b011..52071f7494c4 100644 --- a/drivers/staging/comedi/comedidev.h +++ b/drivers/staging/comedi/comedidev.h @@ -323,6 +323,7 @@ int comedi_dev_put(struct comedi_device *dev); bool comedi_is_subdevice_running(struct comedi_subdevice *s); void *comedi_alloc_spriv(struct comedi_subdevice *s, size_t size); +void comedi_set_spriv_auto_free(struct comedi_subdevice *s); int comedi_check_chanlist(struct comedi_subdevice *s, int n, |