drivers: Use more fpi_ssm_usb_transfer_cb when possible

Replace all the transfer callbacks where we just switch to the next state or
fail with fpi_ssm_usb_transfer_cb.
This commit is contained in:
Marco Trevisan (Treviño)
2019-11-27 20:07:02 +01:00
parent 65d0d5e3e0
commit 587131a6bd
8 changed files with 23 additions and 141 deletions

View File

@@ -501,16 +501,6 @@ enum activate_states {
ACTIVATE_NUM_STATES,
};
static void
init_reqs_ctrl_cb (FpiUsbTransfer *transfer, FpDevice *device,
gpointer user_data, GError *error)
{
if (!error)
fpi_ssm_next_state (transfer->ssm);
else
fpi_ssm_mark_failed (transfer->ssm, error);
}
static void
init_reqs_cb (FpiUsbTransfer *transfer, FpDevice *device,
gpointer user_data, GError *error)
@@ -554,7 +544,7 @@ activate_run_state (FpiSsm *ssm, FpDevice *dev)
transfer->buffer[0] = '\0';
transfer->ssm = ssm;
fpi_usb_transfer_submit (transfer, CTRL_TIMEOUT, NULL,
init_reqs_ctrl_cb, NULL);
fpi_ssm_usb_transfer_cb, NULL);
}
break;