From 0c3a22758b8c86d756df2707fbb215c9f8dc78d8 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 18 Sep 2018 17:57:32 +0200 Subject: [PATCH] drivers: Simplify FP_INSTANCE_DATA(FP_DEV()) calls When fp_dev is already available, don't use the fp_img_dev struct to get to fp_dev with FP_DEV(), use the fp_dev directly. --- libfprint/drivers/aes1610.c | 4 ++-- libfprint/drivers/aes2501.c | 4 ++-- libfprint/drivers/aes2550.c | 2 +- libfprint/drivers/aesx660.c | 7 +++---- libfprint/drivers/elan.c | 10 +++++----- libfprint/drivers/etes603.c | 22 +++++++++++----------- libfprint/drivers/upeksonly.c | 20 +++++++++----------- libfprint/drivers/upektc.c | 6 +++--- libfprint/drivers/upektc_img.c | 10 +++++----- libfprint/drivers/uru4000.c | 10 +++++----- libfprint/drivers/vcom5s.c | 4 ++-- libfprint/drivers/vfs0050.c | 7 +++---- libfprint/drivers/vfs101.c | 6 +++--- libfprint/drivers/vfs301.c | 4 ++-- libfprint/drivers/vfs5011.c | 8 ++++---- 15 files changed, 60 insertions(+), 64 deletions(-) diff --git a/libfprint/drivers/aes1610.c b/libfprint/drivers/aes1610.c index 17f9f06..5aa14c3 100644 --- a/libfprint/drivers/aes1610.c +++ b/libfprint/drivers/aes1610.c @@ -644,7 +644,7 @@ out: static void capture_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct aes1610_dev *aesdev = FP_INSTANCE_DATA(_dev); int r; switch (fpi_ssm_get_cur_state(ssm)) { @@ -691,7 +691,7 @@ static void capture_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data static void capture_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct aes1610_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct aes1610_dev *aesdev = FP_INSTANCE_DATA(_dev); G_DEBUG_HERE(); if (aesdev->deactivating) diff --git a/libfprint/drivers/aes2501.c b/libfprint/drivers/aes2501.c index f91682b..fa72e23 100644 --- a/libfprint/drivers/aes2501.c +++ b/libfprint/drivers/aes2501.c @@ -522,7 +522,7 @@ out: static void capture_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct aes2501_dev *aesdev = FP_INSTANCE_DATA(_dev); int r; switch (fpi_ssm_get_cur_state(ssm)) { @@ -573,7 +573,7 @@ static void capture_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data static void capture_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct aes2501_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct aes2501_dev *aesdev = FP_INSTANCE_DATA(_dev); G_DEBUG_HERE(); if (aesdev->deactivating) diff --git a/libfprint/drivers/aes2550.c b/libfprint/drivers/aes2550.c index 34533b5..5a26012 100644 --- a/libfprint/drivers/aes2550.c +++ b/libfprint/drivers/aes2550.c @@ -388,7 +388,7 @@ static void capture_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data static void capture_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct aes2550_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct aes2550_dev *aesdev = FP_INSTANCE_DATA(_dev); fp_dbg("Capture completed"); if (aesdev->deactivating) diff --git a/libfprint/drivers/aesx660.c b/libfprint/drivers/aesx660.c index 650dc84..d4c2662 100644 --- a/libfprint/drivers/aesx660.c +++ b/libfprint/drivers/aesx660.c @@ -210,7 +210,7 @@ static void finger_det_set_idle_cmd_cb(struct libusb_transfer *transfer) static void finger_det_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct aesX660_dev *aesdev = FP_INSTANCE_DATA(_dev); int err = fpi_ssm_get_error(ssm); fp_dbg("Finger detection completed"); @@ -383,8 +383,7 @@ out: static void capture_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { - struct fp_img_dev *dev = user_data; - struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct aesX660_dev *aesdev = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case CAPTURE_SEND_LED_CMD: @@ -413,7 +412,7 @@ static void capture_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data static void capture_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct aesX660_dev *aesdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct aesX660_dev *aesdev = FP_INSTANCE_DATA(_dev); int err = fpi_ssm_get_error(ssm); fp_dbg("Capture completed"); diff --git a/libfprint/drivers/elan.c b/libfprint/drivers/elan.c index 330f625..2e00259 100644 --- a/libfprint/drivers/elan.c +++ b/libfprint/drivers/elan.c @@ -455,7 +455,7 @@ static void stop_capture_run_state(fpi_ssm *ssm, struct fp_dev *dev, void *user_ static void stop_capture_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct elan_dev *elandev = FP_INSTANCE_DATA(_dev); int error = fpi_ssm_get_error(ssm); G_DEBUG_HERE(); @@ -503,7 +503,7 @@ enum capture_states { static void capture_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct elan_dev *elandev = FP_INSTANCE_DATA(_dev); int r; switch (fpi_ssm_get_cur_state(ssm)) { @@ -541,7 +541,7 @@ static void capture_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data static void capture_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct elan_dev *elandev = FP_INSTANCE_DATA(_dev); G_DEBUG_HERE(); @@ -626,7 +626,7 @@ enum calibrate_states { static void calibrate_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct elan_dev *elandev = FP_INSTANCE_DATA(_dev); G_DEBUG_HERE(); @@ -727,7 +727,7 @@ enum activate_states { static void activate_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct elan_dev *elandev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct elan_dev *elandev = FP_INSTANCE_DATA(_dev); G_DEBUG_HERE(); diff --git a/libfprint/drivers/etes603.c b/libfprint/drivers/etes603.c index 06dea50..2701cb0 100644 --- a/libfprint/drivers/etes603.c +++ b/libfprint/drivers/etes603.c @@ -702,7 +702,7 @@ static void async_tx_cb(struct libusb_transfer *transfer) static void m_exit_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *idev = user_data; - struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev)); + struct etes603_dev *dev = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case EXIT_SET_REGS_REQ: @@ -751,7 +751,7 @@ static void m_exit_start(struct fp_img_dev *idev) static void m_capture_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *idev = user_data; - struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev)); + struct etes603_dev *dev = FP_INSTANCE_DATA(_dev); if (dev->is_active == FALSE) { fpi_ssm_mark_completed(ssm); @@ -832,7 +832,7 @@ err: static void m_capture_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *idev = user_data; - struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev)); + struct etes603_dev *dev = FP_INSTANCE_DATA(_dev); if (fpi_ssm_get_error(ssm)) { if (fpi_imgdev_get_action_state(idev) != IMG_ACQUIRE_STATE_DEACTIVATING) { @@ -854,7 +854,7 @@ static void m_capture_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_dat static void m_finger_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *idev = user_data; - struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev)); + struct etes603_dev *dev = FP_INSTANCE_DATA(_dev); if (dev->is_active == FALSE) { fpi_ssm_mark_completed(ssm); @@ -950,7 +950,7 @@ err: static void m_finger_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *idev = user_data; - struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev)); + struct etes603_dev *dev = FP_INSTANCE_DATA(_dev); if (!fpi_ssm_get_error(ssm)) { fpi_ssm *ssm_cap; @@ -982,7 +982,7 @@ static void m_start_fingerdetect(struct fp_img_dev *idev) static void m_tunevrb_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *idev = user_data; - struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev)); + struct etes603_dev *dev = FP_INSTANCE_DATA(_dev); float hist[5]; if (dev->is_active == FALSE) { @@ -1140,7 +1140,7 @@ static void m_tunevrb_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_dat fp_dbg("Tuning is done. Starting finger detection."); m_start_fingerdetect(idev); } else { - struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev)); + struct etes603_dev *dev = FP_INSTANCE_DATA(_dev); fp_err("Error while tuning VRT"); dev->is_active = FALSE; reset_param(dev); @@ -1156,7 +1156,7 @@ static void m_tunevrb_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_dat static void m_tunedc_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *idev = user_data; - struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev)); + struct etes603_dev *dev = FP_INSTANCE_DATA(_dev); if (dev->is_active == FALSE) { fpi_ssm_mark_completed(ssm); @@ -1265,7 +1265,7 @@ static void m_tunedc_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data TUNEVRB_NUM_STATES, idev); fpi_ssm_start(ssm_tune, m_tunevrb_complete); } else { - struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev)); + struct etes603_dev *dev = FP_INSTANCE_DATA(_dev); fp_err("Error while tuning DCOFFSET"); dev->is_active = FALSE; reset_param(dev); @@ -1277,7 +1277,7 @@ static void m_tunedc_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data static void m_init_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *idev = user_data; - struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev)); + struct etes603_dev *dev = FP_INSTANCE_DATA(_dev); if (dev->is_active == FALSE) { fpi_ssm_mark_completed(ssm); @@ -1384,7 +1384,7 @@ static void m_init_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) TUNEDC_NUM_STATES, idev); fpi_ssm_start(ssm_tune, m_tunedc_complete); } else { - struct etes603_dev *dev = FP_INSTANCE_DATA(FP_DEV(idev)); + struct etes603_dev *dev = FP_INSTANCE_DATA(_dev); fp_err("Error initializing the device"); dev->is_active = FALSE; reset_param(dev); diff --git a/libfprint/drivers/upeksonly.c b/libfprint/drivers/upeksonly.c index cc5588c..8e9cc2f 100644 --- a/libfprint/drivers/upeksonly.c +++ b/libfprint/drivers/upeksonly.c @@ -773,7 +773,7 @@ enum awfsm_1000_states { static void awfsm_2016_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct sonly_dev *sdev = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case AWFSM_2016_WRITEV_1: @@ -863,7 +863,7 @@ capsm_fire_bulk(fpi_ssm *ssm, struct fp_dev *_dev) { struct fp_img_dev *dev = FP_IMG_DEV(_dev); - struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct sonly_dev *sdev = FP_INSTANCE_DATA(_dev); int i; for (i = 0; i < NUM_BULK_TRANSFERS; i++) { int r = libusb_submit_transfer(sdev->img_transfer[i]); @@ -893,7 +893,7 @@ capsm_fire_bulk(fpi_ssm *ssm, static void capsm_2016_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct sonly_dev *sdev = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case CAPSM_2016_INIT: @@ -924,8 +924,7 @@ static void capsm_2016_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_d static void capsm_1000_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { - struct fp_img_dev *dev = user_data; - struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct sonly_dev *sdev = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case CAPSM_1000_INIT: @@ -950,8 +949,7 @@ static void capsm_1000_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_d static void capsm_1001_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { - struct fp_img_dev *dev = user_data; - struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct sonly_dev *sdev = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case CAPSM_1001_INIT: @@ -1060,7 +1058,7 @@ enum initsm_1001_states { static void initsm_2016_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct sonly_dev *sdev = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case INITSM_2016_WRITEV_1: @@ -1132,7 +1130,7 @@ enum loopsm_states { static void loopsm_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct sonly_dev *sdev = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case LOOPSM_RUN_AWFSM: ; @@ -1257,7 +1255,7 @@ static void dev_deactivate(struct fp_img_dev *dev) static void loopsm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct sonly_dev *sdev = FP_INSTANCE_DATA(_dev); int r = fpi_ssm_get_error(ssm); fpi_ssm_free(ssm); @@ -1276,7 +1274,7 @@ static void loopsm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) static void initsm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct sonly_dev *sdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct sonly_dev *sdev = FP_INSTANCE_DATA(_dev); int r = fpi_ssm_get_error(ssm); fpi_ssm_free(ssm); diff --git a/libfprint/drivers/upektc.c b/libfprint/drivers/upektc.c index 43facc2..38a17a4 100644 --- a/libfprint/drivers/upektc.c +++ b/libfprint/drivers/upektc.c @@ -103,7 +103,7 @@ static void read_init_data_cb(struct libusb_transfer *transfer) static void activate_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct upektc_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct upektc_dev *upekdev = FP_INSTANCE_DATA(_dev); int r; switch (fpi_ssm_get_cur_state(ssm)) { @@ -326,7 +326,7 @@ out: static void capture_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct upektc_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct upektc_dev *upekdev = FP_INSTANCE_DATA(_dev); int r; switch (fpi_ssm_get_cur_state(ssm)) { @@ -375,7 +375,7 @@ static void capture_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data static void capture_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct upektc_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct upektc_dev *upekdev = FP_INSTANCE_DATA(_dev); fp_dbg("Capture completed"); if (upekdev->deactivating) diff --git a/libfprint/drivers/upektc_img.c b/libfprint/drivers/upektc_img.c index 6fd62dd..9ca25cb 100644 --- a/libfprint/drivers/upektc_img.c +++ b/libfprint/drivers/upektc_img.c @@ -314,7 +314,7 @@ static void capture_read_data_cb(struct libusb_transfer *transfer) static void capture_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case CAPTURE_INIT_CAPTURE: @@ -351,7 +351,7 @@ static void capture_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data static void capture_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(_dev); int err = fpi_ssm_get_error(ssm); fp_dbg("Capture completed, %d", err); @@ -411,7 +411,7 @@ static void deactivate_read_data_cb(struct libusb_transfer *transfer) static void deactivate_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case DEACTIVATE_DEINIT: @@ -428,7 +428,7 @@ static void deactivate_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_d static void deactivate_sm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(_dev); int err = fpi_ssm_get_error(ssm); fp_dbg("Deactivate completed"); @@ -509,7 +509,7 @@ static void activate_run_state(fpi_ssm *ssm, struct fp_dev *dev, void *user_data { struct libusb_transfer *transfer; struct fp_img_dev *idev = user_data; - struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(FP_DEV(idev)); + struct upektc_img_dev *upekdev = FP_INSTANCE_DATA(dev); int r; switch (fpi_ssm_get_cur_state(ssm)) { diff --git a/libfprint/drivers/uru4000.c b/libfprint/drivers/uru4000.c index c26235b..b2e80e8 100644 --- a/libfprint/drivers/uru4000.c +++ b/libfprint/drivers/uru4000.c @@ -706,7 +706,7 @@ static int calc_dev2(struct uru4k_image *img) static void imaging_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct uru4k_dev *urudev = FP_INSTANCE_DATA(_dev); struct uru4k_image *img = urudev->img_data; struct fp_img *fpimg; uint32_t key; @@ -829,7 +829,7 @@ static void imaging_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data static void imaging_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct uru4k_dev *urudev = FP_INSTANCE_DATA(_dev); int r = fpi_ssm_get_error(ssm); fpi_ssm_free(ssm); @@ -893,7 +893,7 @@ static void rebootpwr_pause_cb(void *data) static void rebootpwr_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct uru4k_dev *urudev = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case REBOOTPWR_SET_HWSTAT: @@ -972,7 +972,7 @@ static void powerup_pause_cb(void *data) static void powerup_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct uru4k_dev *urudev = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case POWERUP_INIT: @@ -1077,7 +1077,7 @@ static void init_scanpwr_timeout(void *user_data) static void init_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct uru4k_dev *urudev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct uru4k_dev *urudev = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case INIT_GET_HWSTAT: diff --git a/libfprint/drivers/vcom5s.c b/libfprint/drivers/vcom5s.c index 0ac931b..64aa64e 100644 --- a/libfprint/drivers/vcom5s.c +++ b/libfprint/drivers/vcom5s.c @@ -274,7 +274,7 @@ enum loop_states { static void loop_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct v5s_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct v5s_dev *vdev = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case LOOP_SET_CONTRAST: @@ -302,7 +302,7 @@ static void loop_run_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) static void loopsm_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct v5s_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct v5s_dev *vdev = FP_INSTANCE_DATA(_dev); int r = fpi_ssm_get_error(ssm); fpi_ssm_free(ssm); diff --git a/libfprint/drivers/vfs0050.c b/libfprint/drivers/vfs0050.c index 5a1bc43..e805ccc 100644 --- a/libfprint/drivers/vfs0050.c +++ b/libfprint/drivers/vfs0050.c @@ -328,7 +328,7 @@ clear_ep2(fpi_ssm *ssm, static void send_control_packet_ssm(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *idev = user_data; - struct vfs_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(idev)); + struct vfs_dev_t *vdev = FP_INSTANCE_DATA(_dev); short result; unsigned char *commit_result = NULL; @@ -529,7 +529,7 @@ static void activate_ssm(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *idev = user_data; struct libusb_device_handle *usb_dev = fpi_dev_get_usb_dev(FP_DEV(idev)); - struct vfs_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(idev)); + struct vfs_dev_t *vdev = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case SSM_INITIAL_ABORT_1: @@ -680,8 +680,7 @@ static void activate_ssm(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) /* Callback for dev_activate ssm */ static void dev_activate_callback(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { - struct fp_img_dev *idev = user_data; - struct vfs_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(idev)); + struct vfs_dev_t *vdev = FP_INSTANCE_DATA(_dev); vdev->ssm_active = 0; diff --git a/libfprint/drivers/vfs101.c b/libfprint/drivers/vfs101.c index 86a2fa1..1d39d33 100644 --- a/libfprint/drivers/vfs101.c +++ b/libfprint/drivers/vfs101.c @@ -941,7 +941,7 @@ enum static void m_loop_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct vfs101_dev *vdev = FP_INSTANCE_DATA(_dev); /* Check action state */ if (!vdev->active) @@ -1205,7 +1205,7 @@ enum static void m_init_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct vfs101_dev *vdev = FP_INSTANCE_DATA(_dev); /* Check action state */ if (!vdev->active) @@ -1446,7 +1446,7 @@ static void m_init_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) static void m_init_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - struct vfs101_dev *vdev = FP_INSTANCE_DATA(FP_DEV(dev)); + struct vfs101_dev *vdev = FP_INSTANCE_DATA(_dev); fpi_ssm *ssm_loop; if (!fpi_ssm_get_error(ssm) && vdev->active) diff --git a/libfprint/drivers/vfs301.c b/libfprint/drivers/vfs301.c index a8085b4..5f469c3 100644 --- a/libfprint/drivers/vfs301.c +++ b/libfprint/drivers/vfs301.c @@ -109,7 +109,7 @@ enum static void m_loop_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - vfs301_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(dev)); + vfs301_dev_t *vdev = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case M_REQUEST_PRINT: @@ -174,7 +174,7 @@ static void m_loop_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) static void m_init_state(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) { struct fp_img_dev *dev = user_data; - vfs301_dev_t *vdev = FP_INSTANCE_DATA(FP_DEV(dev)); + vfs301_dev_t *vdev = FP_INSTANCE_DATA(_dev); g_assert(fpi_ssm_get_cur_state(ssm) == 0); diff --git a/libfprint/drivers/vfs5011.c b/libfprint/drivers/vfs5011.c index ba57b41..ea183a8 100644 --- a/libfprint/drivers/vfs5011.c +++ b/libfprint/drivers/vfs5011.c @@ -676,7 +676,7 @@ static void activate_loop(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) int r; fpi_timeout *timeout; - data = FP_INSTANCE_DATA(FP_DEV(dev)); + data = FP_INSTANCE_DATA(_dev); fp_dbg("main_loop: state %d", fpi_ssm_get_cur_state(ssm)); @@ -750,7 +750,7 @@ static void activate_loop_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user struct vfs5011_data *data; int r = fpi_ssm_get_error(ssm); - data = FP_INSTANCE_DATA(FP_DEV(dev)); + data = FP_INSTANCE_DATA(_dev); fp_dbg("finishing"); if (data->init_sequence.receive_buf != NULL) @@ -779,7 +779,7 @@ static void open_loop(fpi_ssm *ssm, struct fp_dev *_dev, void *user_data) struct fp_img_dev *dev = user_data; struct vfs5011_data *data; - data = FP_INSTANCE_DATA(FP_DEV(dev)); + data = FP_INSTANCE_DATA(_dev); switch (fpi_ssm_get_cur_state(ssm)) { case DEV_OPEN_START: @@ -800,7 +800,7 @@ static void open_loop_complete(fpi_ssm *ssm, struct fp_dev *_dev, void *user_dat struct fp_img_dev *dev = user_data; struct vfs5011_data *data; - data = FP_INSTANCE_DATA(FP_DEV(dev)); + data = FP_INSTANCE_DATA(_dev); g_free(data->init_sequence.receive_buf); data->init_sequence.receive_buf = NULL;