synaptics: Remove unneeded complete error/data parameters

Remove the never-used cmd_complete_data value and the repetition of
cmd_complete_error.

In fact now as per the fpi_device_verify_report() usage, we already pass
the match information to the device, such as the error and it will be
they will be used on completion if needed.

This allows to simplify cmd_ssm_done() as well.
This commit is contained in:
Marco Trevisan (Treviño) 2020-01-16 19:08:10 +01:00 committed by Marco Trevisan
parent 8893840ffa
commit 8be861b876
2 changed files with 3 additions and 16 deletions

View file

@ -279,17 +279,10 @@ cmd_ssm_done (FpiSsm *ssm, FpDevice *dev, GError *error)
self->cmd_ssm = NULL; self->cmd_ssm = NULL;
/* Notify about the SSM failure from here instead. */ /* Notify about the SSM failure from here instead. */
if (error) if (error || self->cmd_complete_on_removal)
{ callback (self, NULL, error);
callback (self, NULL, error);
}
else if (self->cmd_complete_on_removal)
{
callback (self, NULL, self->cmd_complete_error);
self->cmd_complete_error = NULL;
}
self->cmd_complete_on_removal = FALSE; self->cmd_complete_on_removal = FALSE;
g_clear_pointer (&self->cmd_complete_error, g_error_free);
} }
static void static void
@ -621,8 +614,6 @@ verify_msg_cb (FpiDeviceSynaptics *self,
{ {
fp_dbg ("delaying retry error until after finger removal!"); fp_dbg ("delaying retry error until after finger removal!");
self->cmd_complete_on_removal = TRUE; self->cmd_complete_on_removal = TRUE;
self->cmd_complete_data = GINT_TO_POINTER (FPI_MATCH_ERROR);
self->cmd_complete_error = fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL);
fpi_device_verify_report (device, FPI_MATCH_ERROR, NULL, fpi_device_verify_report (device, FPI_MATCH_ERROR, NULL,
fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL)); fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL));
} }
@ -630,8 +621,6 @@ verify_msg_cb (FpiDeviceSynaptics *self,
{ {
fp_dbg ("delaying match failure until after finger removal!"); fp_dbg ("delaying match failure until after finger removal!");
self->cmd_complete_on_removal = TRUE; self->cmd_complete_on_removal = TRUE;
self->cmd_complete_data = GINT_TO_POINTER (FPI_MATCH_FAIL);
self->cmd_complete_error = NULL;
fpi_device_verify_report (device, FPI_MATCH_FAIL, NULL, NULL); fpi_device_verify_report (device, FPI_MATCH_FAIL, NULL, NULL);
} }
else if (resp->result == BMKT_FP_DATABASE_NO_RECORD_EXISTS) else if (resp->result == BMKT_FP_DATABASE_NO_RECORD_EXISTS)

View file

@ -110,8 +110,6 @@ struct _FpiDeviceSynaptics
FpiSsm *cmd_ssm; FpiSsm *cmd_ssm;
FpiUsbTransfer *cmd_pending_transfer; FpiUsbTransfer *cmd_pending_transfer;
gboolean cmd_complete_on_removal; gboolean cmd_complete_on_removal;
GError *cmd_complete_error;
void *cmd_complete_data;
bmkt_sensor_version_t mis_version; bmkt_sensor_version_t mis_version;