staging: comedi: introduce comedi_buf_n_bytes_ready()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 20 Jun 2014 17:58:28 +0000 (10:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2014 00:00:44 +0000 (20:00 -0400)
commitf4f3f7cf27e7ae015672b59ec40c7deabeaf5d2e
tree615d870861548b465c1ae279c94f89407305647f
parent5fc391853ea2a9070ae4161e21783e64c1b79f6c
staging: comedi: introduce comedi_buf_n_bytes_ready()

Introduce an inline helper to return the number of bytes that are
ready to read from the comedi_async buffer. Use the helper in the
comedi drivers that currently do the calculation as part of the
(*poll) operation.

Also, use the helper in comedi_fops where the calculation is used as
part of the subdevice going nonbusy.

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>
drivers/staging/comedi/comedi_fops.c
drivers/staging/comedi/comedidev.h
drivers/staging/comedi/drivers/das16m1.c
drivers/staging/comedi/drivers/das1800.c
drivers/staging/comedi/drivers/ni_mio_common.c
drivers/staging/comedi/drivers/ni_pcidio.c
drivers/staging/comedi/drivers/pcl812.c
drivers/staging/comedi/drivers/pcl816.c