From: David Schleef Date: Tue, 6 Nov 2001 22:16:09 +0000 (+0000) Subject: Added implementation of comedi_poll(). This function may be useful X-Git-Tag: r0_7_61~18 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=de9152246395253786f7eda572ea44fd8a40a054;p=comedi.git Added implementation of comedi_poll(). This function may be useful in the core, although presumably the behavior should be different if the driver doesn't implement poll. --- diff --git a/comedi/drivers/comedi_rt_timer.c b/comedi/drivers/comedi_rt_timer.c index 2d94bf12..bf2dcb57 100644 --- a/comedi/drivers/comedi_rt_timer.c +++ b/comedi/drivers/comedi_rt_timer.c @@ -567,6 +567,13 @@ static int timer_start_cmd(comedi_device *dev, comedi_subdevice *s) return 0; } +static int timer_poll(comedi_device *dev,comedi_subdevice *s) +{ + /* This it pretty generic code, perhaps it should be the + * default for any subdevice that doesn't implement poll. */ + return s->async->buf_int_count - s->async->buf_user_count; +} + static int timer_attach(comedi_device *dev,comedi_devconfig *it) { int ret; @@ -603,6 +610,7 @@ static int timer_attach(comedi_device *dev,comedi_devconfig *it) // input or output subdevice s=dev->subdevices+0; + s->poll=timer_poll; if(emul_s->type == COMEDI_SUBD_AI) { s->type=emul_s->type;