aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2016-07-13 03:33:58 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-07-15 12:10:43 -0400
commit86e3577f11d0aa8a5d3c6199f9e3f23cdbd0c0ac (patch)
treef0f4ac148083adb9a6f1ffd03089aa3a760613eb
parent19e476c7b0b86cf7953fe1eaa01f90f8bd9d8ab7 (diff)
[media] cec: don't zero reply and timeout on error
There is really no reason to zero the reply and timeout fields if an error occurs. This is a left-over from earlier versions where that was used to signal errors, but this is now handled by the rx/tx_status fields. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/staging/media/cec/cec-adap.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/staging/media/cec/cec-adap.c b/drivers/staging/media/cec/cec-adap.c
index ca34339e3eba..07147a1d2b6b 100644
--- a/drivers/staging/media/cec/cec-adap.c
+++ b/drivers/staging/media/cec/cec-adap.c
@@ -289,7 +289,6 @@ static void cec_data_cancel(struct cec_data *data)
289 CEC_TX_STATUS_MAX_RETRIES; 289 CEC_TX_STATUS_MAX_RETRIES;
290 data->attempts = 0; 290 data->attempts = 0;
291 data->msg.tx_error_cnt = 1; 291 data->msg.tx_error_cnt = 1;
292 data->msg.reply = 0;
293 /* Queue transmitted message for monitoring purposes */ 292 /* Queue transmitted message for monitoring purposes */
294 cec_queue_msg_monitor(data->adap, &data->msg, 1); 293 cec_queue_msg_monitor(data->adap, &data->msg, 1);
295 294
@@ -511,16 +510,8 @@ void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt,
511 /* Queue transmitted message for monitoring purposes */ 510 /* Queue transmitted message for monitoring purposes */
512 cec_queue_msg_monitor(adap, msg, 1); 511 cec_queue_msg_monitor(adap, msg, 1);
513 512
514 /* 513 if ((status & CEC_TX_STATUS_OK) && adap->is_configured &&
515 * Clear reply and timeout on error or if the adapter is no longer 514 msg->timeout) {
516 * configured. It makes no sense to wait for a reply in that case.
517 */
518 if (!(status & CEC_TX_STATUS_OK) || !adap->is_configured) {
519 msg->reply = 0;
520 msg->timeout = 0;
521 }
522
523 if (msg->timeout) {
524 /* 515 /*
525 * Queue the message into the wait queue if we want to wait 516 * Queue the message into the wait queue if we want to wait
526 * for a reply. 517 * for a reply.
@@ -648,6 +639,8 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg,
648 dprintk(2, "cec_transmit_msg: %*ph%s\n", 639 dprintk(2, "cec_transmit_msg: %*ph%s\n",
649 msg->len, msg->msg, !block ? " (nb)" : ""); 640 msg->len, msg->msg, !block ? " (nb)" : "");
650 641
642 msg->rx_ts = 0;
643 msg->tx_ts = 0;
651 msg->rx_status = 0; 644 msg->rx_status = 0;
652 msg->tx_status = 0; 645 msg->tx_status = 0;
653 msg->tx_arb_lost_cnt = 0; 646 msg->tx_arb_lost_cnt = 0;
@@ -812,10 +805,8 @@ void cec_received_msg(struct cec_adapter *adap, struct cec_msg *msg)
812 dst->len = msg->len; 805 dst->len = msg->len;
813 dst->rx_ts = msg->rx_ts; 806 dst->rx_ts = msg->rx_ts;
814 dst->rx_status = msg->rx_status; 807 dst->rx_status = msg->rx_status;
815 if (abort) { 808 if (abort)
816 dst->reply = 0;
817 dst->rx_status |= CEC_RX_STATUS_FEATURE_ABORT; 809 dst->rx_status |= CEC_RX_STATUS_FEATURE_ABORT;
818 }
819 /* Remove it from the wait_queue */ 810 /* Remove it from the wait_queue */
820 list_del_init(&data->list); 811 list_del_init(&data->list);
821 812