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.
This commit is contained in:
Bastien Nocera 2018-09-18 17:57:32 +02:00
parent 9cc859a318
commit 0c3a22758b
15 changed files with 60 additions and 64 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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");

View file

@ -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();

View file

@ -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);

View file

@ -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);

View file

@ -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)

View file

@ -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)) {

View file

@ -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:

View file

@ -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);

View file

@ -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;

View file

@ -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)

View file

@ -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);

View file

@ -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;