diff --git a/libfprint/drivers/aes1610.c b/libfprint/drivers/aes1610.c index 1e7b3b9..927cca7 100644 --- a/libfprint/drivers/aes1610.c +++ b/libfprint/drivers/aes1610.c @@ -749,7 +749,7 @@ static void activate_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_d fpi_ssm_free(ssm); } -static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state) +static int dev_activate(struct fp_img_dev *dev) { struct aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev)); fpi_ssm *ssm = fpi_ssm_new(FP_DEV(dev), activate_run_state, diff --git a/libfprint/drivers/aes2501.c b/libfprint/drivers/aes2501.c index 2a03173..3511893 100644 --- a/libfprint/drivers/aes2501.c +++ b/libfprint/drivers/aes2501.c @@ -792,7 +792,7 @@ static void activate_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_d fpi_ssm_free(ssm); } -static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state) +static int dev_activate(struct fp_img_dev *dev) { struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev)); fpi_ssm *ssm = fpi_ssm_new(FP_DEV(dev), activate_run_state, diff --git a/libfprint/drivers/aes2550.c b/libfprint/drivers/aes2550.c index ce5b6c2..ba021d3 100644 --- a/libfprint/drivers/aes2550.c +++ b/libfprint/drivers/aes2550.c @@ -541,7 +541,7 @@ static void activate_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_d fpi_ssm_free(ssm); } -static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state) +static int dev_activate(struct fp_img_dev *dev) { fpi_ssm *ssm = fpi_ssm_new(FP_DEV(dev), activate_run_state, ACTIVATE_NUM_STATES, dev); diff --git a/libfprint/drivers/aes3k.c b/libfprint/drivers/aes3k.c index 59c91bc..ddb94c9 100644 --- a/libfprint/drivers/aes3k.c +++ b/libfprint/drivers/aes3k.c @@ -137,7 +137,7 @@ static void init_reqs_cb(struct fp_img_dev *dev, int result, void *user_data) do_capture(dev); } -int aes3k_dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state) +int aes3k_dev_activate(struct fp_img_dev *dev) { struct aes3k_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev)); aes_write_regv(dev, aesdev->init_reqs, aesdev->init_reqs_len, init_reqs_cb, NULL); diff --git a/libfprint/drivers/aes3k.h b/libfprint/drivers/aes3k.h index 98750ed..a54199d 100644 --- a/libfprint/drivers/aes3k.h +++ b/libfprint/drivers/aes3k.h @@ -52,7 +52,7 @@ struct aes3k_dev { }; -int aes3k_dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state); +int aes3k_dev_activate(struct fp_img_dev *dev); void aes3k_dev_deactivate(struct fp_img_dev *dev); #endif diff --git a/libfprint/drivers/aesx660.c b/libfprint/drivers/aesx660.c index 852c750..47da51f 100644 --- a/libfprint/drivers/aesx660.c +++ b/libfprint/drivers/aesx660.c @@ -589,7 +589,7 @@ static void activate_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_d start_finger_detection(dev); } -int aesX660_dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state) +int aesX660_dev_activate(struct fp_img_dev *dev) { fpi_ssm *ssm = fpi_ssm_new(FP_DEV(dev), activate_run_state, ACTIVATE_NUM_STATES, dev); diff --git a/libfprint/drivers/aesx660.h b/libfprint/drivers/aesx660.h index 2106ca2..8d8f350 100644 --- a/libfprint/drivers/aesx660.h +++ b/libfprint/drivers/aesx660.h @@ -116,7 +116,7 @@ static const unsigned char calibrate_cmd[] = { 0x06, }; -int aesX660_dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state); +int aesX660_dev_activate(struct fp_img_dev *dev); void aesX660_dev_deactivate(struct fp_img_dev *dev); #endif diff --git a/libfprint/drivers/elan.c b/libfprint/drivers/elan.c index 3314d8d..7c014aa 100644 --- a/libfprint/drivers/elan.c +++ b/libfprint/drivers/elan.c @@ -874,7 +874,7 @@ static void dev_deinit(struct fp_img_dev *dev) fpi_imgdev_close_complete(dev); } -static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state) +static int dev_activate(struct fp_img_dev *dev) { G_DEBUG_HERE(); elan_activate(dev); diff --git a/libfprint/drivers/etes603.c b/libfprint/drivers/etes603.c index 8f3ec45..f46a4a5 100644 --- a/libfprint/drivers/etes603.c +++ b/libfprint/drivers/etes603.c @@ -1390,19 +1390,13 @@ static void m_init_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) fpi_ssm_free(ssm); } -static int dev_activate(struct fp_img_dev *idev, enum fp_imgdev_state state) +static int dev_activate(struct fp_img_dev *idev) { struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev)); fpi_ssm *ssm; g_assert(dev); - if (state != IMGDEV_STATE_AWAIT_FINGER_ON) { - fp_err("The driver is in an unexpected state: %d.", state); - fpi_imgdev_activate_complete(idev, 1); - return -1; - } - /* Reset info and data */ dev->is_active = TRUE; diff --git a/libfprint/drivers/upeksonly.c b/libfprint/drivers/upeksonly.c index 99c5ffa..2f37cef 100644 --- a/libfprint/drivers/upeksonly.c +++ b/libfprint/drivers/upeksonly.c @@ -1268,7 +1268,7 @@ static void initsm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) fpi_ssm_start(sdev->loopsm, loopsm_complete); } -static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state) +static int dev_activate(struct fp_img_dev *dev) { struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev)); fpi_ssm *ssm = NULL; diff --git a/libfprint/drivers/upektc.c b/libfprint/drivers/upektc.c index 0042833..00d9c55 100644 --- a/libfprint/drivers/upektc.c +++ b/libfprint/drivers/upektc.c @@ -377,7 +377,7 @@ static void start_capture(struct fp_img_dev *dev) fpi_ssm_start(ssm, capture_sm_complete); } -static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state) +static int dev_activate(struct fp_img_dev *dev) { struct upektc_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev)); fpi_ssm *ssm = fpi_ssm_new(FP_DEV(dev), activate_run_state, diff --git a/libfprint/drivers/upektc_img.c b/libfprint/drivers/upektc_img.c index d749ac5..dfa1602 100644 --- a/libfprint/drivers/upektc_img.c +++ b/libfprint/drivers/upektc_img.c @@ -567,7 +567,7 @@ static void activate_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_d start_capture(dev); } -static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state) +static int dev_activate(struct fp_img_dev *dev) { struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev)); fpi_ssm *ssm = fpi_ssm_new(FP_DEV(dev), activate_run_state, diff --git a/libfprint/drivers/uru4000.c b/libfprint/drivers/uru4000.c index 7e54add..8f648ef 100644 --- a/libfprint/drivers/uru4000.c +++ b/libfprint/drivers/uru4000.c @@ -1161,20 +1161,10 @@ static void activate_initsm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *us int r = fpi_ssm_get_error(ssm); fpi_ssm_free(ssm); - if (r) { - fpi_imgdev_activate_complete(dev, r); - return; - } - - r = execute_state_change(dev); fpi_imgdev_activate_complete(dev, r); } -/* FIXME: having state parameter here is kinda useless, will we ever - * see a scenario where the parameter is useful so early on in the activation - * process? asynchronity means that it'll only be used in a later function - * call. */ -static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state) +static int dev_activate(struct fp_img_dev *dev) { struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev)); fpi_ssm *ssm; @@ -1185,7 +1175,6 @@ static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state) return r; urudev->scanpwr_irq_timeouts = 0; - urudev->activate_state = state; ssm = fpi_ssm_new(FP_DEV(dev), init_run_state, INIT_NUM_STATES, dev); fpi_ssm_start(ssm, activate_initsm_complete); return 0; diff --git a/libfprint/drivers/vcom5s.c b/libfprint/drivers/vcom5s.c index 4ed71f6..b0c6c45 100644 --- a/libfprint/drivers/vcom5s.c +++ b/libfprint/drivers/vcom5s.c @@ -302,7 +302,7 @@ static void loopsm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) fpi_imgdev_deactivate_complete(dev); } -static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state) +static int dev_activate(struct fp_img_dev *dev) { struct v5s_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev)); fpi_ssm *ssm = fpi_ssm_new(FP_DEV(dev), loop_run_state, diff --git a/libfprint/drivers/vfs0050.c b/libfprint/drivers/vfs0050.c index a437df4..3f9bbf0 100644 --- a/libfprint/drivers/vfs0050.c +++ b/libfprint/drivers/vfs0050.c @@ -684,7 +684,7 @@ static void dev_activate_callback(fpi_ssm *ssm, struct fp_dev *_dev, void *user_ } /* Activate device */ -static int dev_activate(struct fp_img_dev *idev, enum fp_imgdev_state state) +static int dev_activate(struct fp_img_dev *idev) { struct vfs_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(idev)); diff --git a/libfprint/drivers/vfs101.c b/libfprint/drivers/vfs101.c index 8faaa23..af64a58 100644 --- a/libfprint/drivers/vfs101.c +++ b/libfprint/drivers/vfs101.c @@ -1424,7 +1424,7 @@ static void m_init_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) } /* Activate device */ -static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state) +static int dev_activate(struct fp_img_dev *dev) { struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev)); fpi_ssm *ssm; diff --git a/libfprint/drivers/vfs301.c b/libfprint/drivers/vfs301.c index 4116e71..94837de 100644 --- a/libfprint/drivers/vfs301.c +++ b/libfprint/drivers/vfs301.c @@ -191,7 +191,7 @@ static void m_init_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) } /* Activate device */ -static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state) +static int dev_activate(struct fp_img_dev *dev) { fpi_ssm *ssm; diff --git a/libfprint/drivers/vfs5011.c b/libfprint/drivers/vfs5011.c index e185833..ec62317 100644 --- a/libfprint/drivers/vfs5011.c +++ b/libfprint/drivers/vfs5011.c @@ -846,7 +846,7 @@ static void start_scan(struct fp_img_dev *dev) fp_dbg("ssm done, getting out"); } -static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state) +static int dev_activate(struct fp_img_dev *dev) { struct vfs5011_data *data; diff --git a/libfprint/fpi-core.h b/libfprint/fpi-core.h index a5a0a44..d183f88 100644 --- a/libfprint/fpi-core.h +++ b/libfprint/fpi-core.h @@ -110,7 +110,7 @@ struct fp_img_driver { /* Device operations */ int (*open)(struct fp_img_dev *dev, unsigned long driver_data); void (*close)(struct fp_img_dev *dev); - int (*activate)(struct fp_img_dev *dev, enum fp_imgdev_state state); + int (*activate)(struct fp_img_dev *dev); int (*change_state)(struct fp_img_dev *dev, enum fp_imgdev_state state); void (*deactivate)(struct fp_img_dev *dev); }; diff --git a/libfprint/fpi-dev-img.c b/libfprint/fpi-dev-img.c index 93f1f47..a7c2410 100644 --- a/libfprint/fpi-dev-img.c +++ b/libfprint/fpi-dev-img.c @@ -533,14 +533,14 @@ int fpi_imgdev_get_img_height(struct fp_img_dev *imgdev) return height; } -static int dev_activate(struct fp_img_dev *imgdev, enum fp_imgdev_state state) +static int dev_activate(struct fp_img_dev *imgdev) { struct fp_driver *drv = FP_DEV(imgdev)->drv; struct fp_img_driver *imgdrv = fpi_driver_to_img_driver(drv); if (!imgdrv->activate) return 0; - return imgdrv->activate(imgdev, state); + return imgdrv->activate(imgdev); } static void dev_deactivate(struct fp_img_dev *imgdev) @@ -562,7 +562,7 @@ static int generic_acquire_start(struct fp_dev *dev, int action) imgdev->action_state = IMG_ACQUIRE_STATE_ACTIVATING; imgdev->enroll_stage = 0; - r = dev_activate(imgdev, IMGDEV_STATE_AWAIT_FINGER_ON); + r = dev_activate(imgdev); if (r < 0) fp_err("activation failed with error %d", r);