This function assumes that the async subdevice has a cancel() function.
It looks like all the current comedi drivers implement a cancel() for
the async subdevices except for the dt2814 analog input usbdevice.
Fix comedi_handle_events() so it does not try to call a non-existent
cancel() function.
Add a dev_warn() to __comedi_device_postconfig_async() so that any new
driver authors will be reminded to implement the cancel().
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>
        if (events == 0)
                return events;
 
-       if (events & COMEDI_CB_CANCEL_MASK)
+       if ((events & COMEDI_CB_CANCEL_MASK) && s->cancel)
                s->cancel(dev, s);
 
        comedi_event(dev, s);
                         "async subdevices must have a do_cmdtest() function\n");
                return -EINVAL;
        }
+       if (!s->cancel)
+               dev_warn(dev->class_dev,
+                        "async subdevices should have a cancel() function\n");
 
        async = kzalloc(sizeof(*async), GFP_KERNEL);
        if (!async)