From c91819f551d69e720d55dc326c3e8fbf8f12c645 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 31 May 2018 10:56:46 +0200 Subject: [PATCH] lib: Remove drv->close absence support in fp_async_dev_close() The driver will at least need to close its hardware resources, and free memory, so it must have had one. This case was never actually used as can be seen from the fact that we would assert in fpi_drvcb_close_complete() if the state was wrong but never set it to the expected value. --- libfprint/async.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libfprint/async.c b/libfprint/async.c index 35da875..7051ee7 100644 --- a/libfprint/async.c +++ b/libfprint/async.c @@ -114,18 +114,14 @@ API_EXPORTED void fp_async_dev_close(struct fp_dev *dev, drv = dev->drv; + g_return_if_fail (drv->close != NULL); + if (g_slist_index(opened_devices, (gconstpointer) dev) == -1) fp_err("device %p not in opened list!", dev); opened_devices = g_slist_remove(opened_devices, (gconstpointer) dev); dev->close_cb = callback; dev->close_cb_data = user_data; - - if (!drv->close) { - fpi_drvcb_close_complete(dev); - return; - } - dev->state = DEV_STATE_DEINITIALIZING; drv->close(dev); }