summaryrefslogtreecommitdiffstats
path: root/drivers/staging/vt6656/rf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/vt6656/rf.c')
-rw-r--r--drivers/staging/vt6656/rf.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 18f75dcc65d2..43237b7e1dbe 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -811,8 +811,9 @@ void vnt_rf_rssi_to_dbm(struct vnt_private *priv, u8 rssi, long *dbm)
*dbm = -1 * (a + b * 2);
}
-void vnt_rf_table_download(struct vnt_private *priv)
+int vnt_rf_table_download(struct vnt_private *priv)
{
+ int ret = 0;
u16 length1 = 0, length2 = 0, length3 = 0;
u8 *addr1 = NULL, *addr2 = NULL, *addr3 = NULL;
u16 length, value;
@@ -865,8 +866,10 @@ void vnt_rf_table_download(struct vnt_private *priv)
/* Init Table */
memcpy(array, addr1, length1);
- vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0,
- MESSAGE_REQUEST_RF_INIT, length1, array);
+ ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0,
+ MESSAGE_REQUEST_RF_INIT, length1, array);
+ if (ret)
+ goto end;
/* Channel Table 0 */
value = 0;
@@ -878,8 +881,10 @@ void vnt_rf_table_download(struct vnt_private *priv)
memcpy(array, addr2, length);
- vnt_control_out(priv, MESSAGE_TYPE_WRITE,
- value, MESSAGE_REQUEST_RF_CH0, length, array);
+ ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE, value,
+ MESSAGE_REQUEST_RF_CH0, length, array);
+ if (ret)
+ goto end;
length2 -= length;
value += length;
@@ -896,8 +901,10 @@ void vnt_rf_table_download(struct vnt_private *priv)
memcpy(array, addr3, length);
- vnt_control_out(priv, MESSAGE_TYPE_WRITE,
- value, MESSAGE_REQUEST_RF_CH1, length, array);
+ ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE, value,
+ MESSAGE_REQUEST_RF_CH1, length, array);
+ if (ret)
+ goto end;
length3 -= length;
value += length;
@@ -913,8 +920,10 @@ void vnt_rf_table_download(struct vnt_private *priv)
memcpy(array, addr1, length1);
/* Init Table 2 */
- vnt_control_out(priv, MESSAGE_TYPE_WRITE,
- 0, MESSAGE_REQUEST_RF_INIT2, length1, array);
+ ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0,
+ MESSAGE_REQUEST_RF_INIT2, length1, array);
+ if (ret)
+ goto end;
/* Channel Table 0 */
value = 0;
@@ -926,13 +935,18 @@ void vnt_rf_table_download(struct vnt_private *priv)
memcpy(array, addr2, length);
- vnt_control_out(priv, MESSAGE_TYPE_WRITE,
- value, MESSAGE_REQUEST_RF_CH2,
- length, array);
+ ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE, value,
+ MESSAGE_REQUEST_RF_CH2, length,
+ array);
+ if (ret)
+ goto end;
length2 -= length;
value += length;
addr2 += length;
}
}
+
+end:
+ return ret;
}