lib: Fix examples not working

Remove the sanity check added in commit b1afa9d, having a poll setup
isn't necessary to use timeouts, as long as only sync functions are
used.

Closes: #139
This commit is contained in:
Bastien Nocera 2018-12-30 16:35:33 +01:00
parent 1abe213844
commit a1e46de462

View file

@ -91,8 +91,6 @@ struct fpi_timeout {
char *name;
};
static gboolean fpi_poll_is_setup(void);
static int timeout_sort_fn(gconstpointer _a, gconstpointer _b)
{
fpi_timeout *a = (fpi_timeout *) _a;
@ -167,7 +165,6 @@ fpi_timeout *fpi_timeout_add(unsigned int msec,
int r;
g_return_val_if_fail (dev != NULL, NULL);
g_return_val_if_fail (fpi_poll_is_setup(), NULL);
fp_dbg("in %dms", msec);
@ -487,12 +484,6 @@ void fpi_poll_exit(void)
libusb_set_pollfd_notifiers(fpi_usb_ctx, NULL, NULL, NULL);
}
static gboolean
fpi_poll_is_setup(void)
{
return (fd_added_cb != NULL && fd_removed_cb != NULL);
}
void
fpi_timeout_cancel_all_for_dev(struct fp_dev *dev)
{