summaryrefslogtreecommitdiff
path: root/packages/librfid/files/soos02-check-errors.patch
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2008-12-23 00:24:22 +0100
committerJeremy Lainé <jeremy.laine@m4x.org>2008-12-23 00:24:22 +0100
commit8e655cf40735ed91c162e75701ed94c927fb93f2 (patch)
tree00ebad12b872c5c8cae0b1fa783a3aae93f5d025 /packages/librfid/files/soos02-check-errors.patch
parent762ef6bea06fe8a8e62936c82f7530ef4ce132f8 (diff)
librfid: cherrypick patches from http://www.nixda.biz/librfid/
Diffstat (limited to 'packages/librfid/files/soos02-check-errors.patch')
-rw-r--r--packages/librfid/files/soos02-check-errors.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/packages/librfid/files/soos02-check-errors.patch b/packages/librfid/files/soos02-check-errors.patch
new file mode 100644
index 0000000000..6c40516336
--- /dev/null
+++ b/packages/librfid/files/soos02-check-errors.patch
@@ -0,0 +1,36 @@
+diff --git a/src/rfid_asic_rc632.c b/src/rfid_asic_rc632.c
+index b9b1aff..f0948c6 100644
+--- a/src/rfid_asic_rc632.c
++++ b/src/rfid_asic_rc632.c
+@@ -297,7 +297,9 @@ static int rc632_wait_idle_timer(struct rfid_asic_handle *handle)
+ DEBUGP_STATUS_FLAG(stat);
+ if (stat & RC632_STAT_ERR) {
+ u_int8_t err;
+- rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &err);
++ ret = rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &err);
++ if (ret < 0)
++ return ret;
+ DEBUGP_ERROR_FLAG(err);
+ if (err & (RC632_ERR_FLAG_COL_ERR |
+ RC632_ERR_FLAG_PARITY_ERR |
+@@ -457,14 +459,16 @@ rc632_transceive(struct rfid_asic_handle *handle,
+
+
+ ret = rc632_reg_write(handle, RC632_REG_COMMAND, RC632_CMD_IDLE);
++ if (ret < 0)
++ return ret;
+ /* clear all interrupts */
+- rc632_clear_spec_bits(handle, RC632_REG_INTERRUPT_RQ, RC632_INT_ALL);
++ ret = rc632_clear_spec_bits(handle, RC632_REG_INTERRUPT_RQ, RC632_INT_ALL);
++ if (ret < 0)
++ return ret;
+
+ { u_int8_t tmp;
+ rc632_reg_read(handle, RC632_REG_PRIMARY_STATUS, &tmp);
+ DEBUGP_STATUS_FLAG(tmp);
+- rc632_reg_read(handle, RC632_REG_PRIMARY_STATUS, &tmp);
+- DEBUGP_STATUS_FLAG(tmp);
+ rc632_reg_read(handle, RC632_REG_ERROR_FLAG, &tmp);
+ DEBUGP_ERROR_FLAG(tmp);
+ }
+