drivers: Use clearer messages using parameters

This commit is contained in:
Marco Trevisan (Treviño) 2019-11-25 21:23:31 +01:00 committed by Benjamin Berg
parent f6559ba8b1
commit 1b23f0efe1
3 changed files with 28 additions and 13 deletions

View file

@ -131,7 +131,9 @@ aesX660_read_calibrate_data_cb (FpiUsbTransfer *transfer,
fp_dbg ("Bogus calibrate response: %.2x\n", data[0]); fp_dbg ("Bogus calibrate response: %.2x\n", data[0]);
fpi_ssm_mark_failed (transfer->ssm, fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
"Bogus calibrate response")); "Bogus calibrate "
"response: %.2x",
data[0]));
return; return;
} }
@ -175,7 +177,8 @@ finger_det_read_fd_data_cb (FpiUsbTransfer *transfer,
fp_dbg ("Bogus FD response: %.2x\n", data[0]); fp_dbg ("Bogus FD response: %.2x\n", data[0]);
fpi_ssm_mark_failed (transfer->ssm, fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
"Bogus FD response")); "Bogus FD response %.2x",
data[0]));
return; return;
} }
@ -538,7 +541,8 @@ activate_read_id_cb (FpiUsbTransfer *transfer, FpDevice *device,
fp_dbg ("Bogus read ID response: %.2x\n", data[AESX660_RESPONSE_TYPE_OFFSET]); fp_dbg ("Bogus read ID response: %.2x\n", data[AESX660_RESPONSE_TYPE_OFFSET]);
fpi_ssm_mark_failed (transfer->ssm, fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
"Bogus read ID response")); "Bogus read ID response %.2x",
data[AESX660_RESPONSE_TYPE_OFFSET]));
return; return;
} }
@ -565,7 +569,8 @@ activate_read_id_cb (FpiUsbTransfer *transfer, FpDevice *device,
fp_dbg ("Failed to init device! init status: %.2x\n", data[7]); fp_dbg ("Failed to init device! init status: %.2x\n", data[7]);
fpi_ssm_mark_failed (transfer->ssm, fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
"Failed to init device")); "Failed to init device %.2x",
data[7]));
break; break;
} }
} }
@ -594,7 +599,8 @@ activate_read_init_cb (FpiUsbTransfer *transfer, FpDevice *device,
data[3]); data[3]);
fpi_ssm_mark_failed (transfer->ssm, fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
"Bogus read init response")); "Bogus read init response: "
"%.2x %.2x", data[0], data[3]));
return; return;
} }
priv->init_cmd_idx++; priv->init_cmd_idx++;

View file

@ -137,7 +137,8 @@ cmd_recieve_cb (FpiUsbTransfer *transfer,
fp_warn ("Received General Error %d from the sensor", (guint) err); fp_warn ("Received General Error %d from the sensor", (guint) err);
fpi_ssm_mark_failed (transfer->ssm, fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
"Received general error from device")); "Received general error %u from device",
(guint) err));
//fpi_ssm_jump_to_state (transfer->ssm, fpi_ssm_get_cur_state (transfer->ssm)); //fpi_ssm_jump_to_state (transfer->ssm, fpi_ssm_get_cur_state (transfer->ssm));
return; return;
} }
@ -472,7 +473,8 @@ list_msg_cb (FpiDeviceSynaptics *self,
fpi_device_list_complete (FP_DEVICE (self), fpi_device_list_complete (FP_DEVICE (self),
NULL, NULL,
fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL, fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL,
"Failed to query enrolled users")); "Failed to query enrolled users: %d",
resp->result));
} }
break; break;
@ -770,7 +772,8 @@ enroll_msg_cb (FpiDeviceSynaptics *self,
fpi_device_enroll_complete (device, fpi_device_enroll_complete (device,
NULL, NULL,
fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL, fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL,
"Enrollment failed")); "Enrollment failed (%d)",
resp->result));
} }
break; break;
} }
@ -1052,7 +1055,11 @@ dev_probe (FpDevice *device)
self->mis_version.build_num); self->mis_version.build_num);
error = fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL, error = fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL,
"Unsupported firmware version"); "Unsupported firmware version "
"(%d.%d with build number %d)",
self->mis_version.version_major,
self->mis_version.version_minor,
self->mis_version.build_num);
goto err_close; goto err_close;
} }
@ -1120,7 +1127,7 @@ fps_deinit_cb (FpiDeviceSynaptics *self,
case BMKT_RSP_POWER_DOWN_FAIL: case BMKT_RSP_POWER_DOWN_FAIL:
fp_info ("Failed to go to power down mode: %d", resp->result); fp_info ("Failed to go to power down mode: %d", resp->result);
error = fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL, error = fpi_device_error_new_msg (FP_DEVICE_ERROR_GENERAL,
"Power down failed"); "Power down failed: %d", resp->result);
break; break;
} }

View file

@ -288,7 +288,7 @@ __handle_incoming_msg (FpDevice *device,
{ {
fp_warn ("cmd response too short (%d)", len); fp_warn ("cmd response too short (%d)", len);
error = fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, error = fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
"CMD response too short"); "CMD response too short (%d)", len);
goto err; goto err;
} }
if (innerbuf[0] != 0x28) if (innerbuf[0] != 0x28)
@ -371,7 +371,8 @@ read_msg_cb (FpiUsbTransfer *transfer, FpDevice *device,
fp_err ("async msg read too short (%d)", fp_err ("async msg read too short (%d)",
(gint) transfer->actual_length); (gint) transfer->actual_length);
error = fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, error = fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
"Packet from device was too short"); "Packet from device was too short (%lu)",
transfer->actual_length);
goto err; goto err;
} }
@ -798,7 +799,8 @@ read_msg01_cb (FpDevice *dev, enum read_msg_type type,
{ {
fp_err ("expected seq=1, got %x", seq); fp_err ("expected seq=1, got %x", seq);
fpi_ssm_mark_failed (ssm, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, fpi_ssm_mark_failed (ssm, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
"Got wrong sequence number")); "Got wrong sequence number (%x)",
seq));
return; return;
} }