[media] stih-cec/vivid/pulse8/rainshadow: use cec_transmit_attempt_done
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 7 Jun 2017 14:46:11 +0000 (11:46 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 20 Jun 2017 09:53:20 +0000 (06:53 -0300)
Use the helper function cec_transmit_attempt_done instead of
cec_transmit_done to simplify the code.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/sti/cec/stih-cec.c
drivers/media/platform/vivid/vivid-cec.c
drivers/media/usb/pulse8-cec/pulse8-cec.c
drivers/media/usb/rainshadow-cec/rainshadow-cec.c

index 6f9f03670b569027de622df057b8d440a14f937c..dccbdaebb7a8cb268f266e00620effe2939c4770 100644 (file)
@@ -226,22 +226,21 @@ static int stih_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
 static void stih_tx_done(struct stih_cec *cec, u32 status)
 {
        if (status & CEC_TX_ERROR) {
-               cec_transmit_done(cec->adap, CEC_TX_STATUS_ERROR, 0, 0, 0, 1);
+               cec_transmit_attempt_done(cec->adap, CEC_TX_STATUS_ERROR);
                return;
        }
 
        if (status & CEC_TX_ARB_ERROR) {
-               cec_transmit_done(cec->adap,
-                                 CEC_TX_STATUS_ARB_LOST, 1, 0, 0, 0);
+               cec_transmit_attempt_done(cec->adap, CEC_TX_STATUS_ARB_LOST);
                return;
        }
 
        if (!(status & CEC_TX_ACK_GET_STS)) {
-               cec_transmit_done(cec->adap, CEC_TX_STATUS_NACK, 0, 1, 0, 0);
+               cec_transmit_attempt_done(cec->adap, CEC_TX_STATUS_NACK);
                return;
        }
 
-       cec_transmit_done(cec->adap, CEC_TX_STATUS_OK, 0, 0, 0, 0);
+       cec_transmit_attempt_done(cec->adap, CEC_TX_STATUS_OK);
 }
 
 static void stih_rx_done(struct stih_cec *cec, u32 status)
index 653f4099f737a0bd49563cd5d969f619a8fd6e2f..e157057589698d698370df824b88bb5ffe1f9c0e 100644 (file)
@@ -34,7 +34,7 @@ void vivid_cec_bus_free_work(struct vivid_dev *dev)
                cancel_delayed_work_sync(&cw->work);
                spin_lock(&dev->cec_slock);
                list_del(&cw->list);
-               cec_transmit_done(cw->adap, CEC_TX_STATUS_LOW_DRIVE, 0, 0, 1, 0);
+               cec_transmit_attempt_done(cw->adap, CEC_TX_STATUS_LOW_DRIVE);
                kfree(cw);
        }
        spin_unlock(&dev->cec_slock);
@@ -84,7 +84,7 @@ static void vivid_cec_xfer_done_worker(struct work_struct *work)
        dev->cec_xfer_start_jiffies = 0;
        list_del(&cw->list);
        spin_unlock(&dev->cec_slock);
-       cec_transmit_done(cw->adap, cw->tx_status, 0, valid_dest ? 0 : 1, 0, 0);
+       cec_transmit_attempt_done(cw->adap, cw->tx_status);
 
        /* Broadcast message */
        if (adap != dev->cec_rx_adap)
@@ -105,7 +105,7 @@ static void vivid_cec_xfer_try_worker(struct work_struct *work)
        if (dev->cec_xfer_time_jiffies) {
                list_del(&cw->list);
                spin_unlock(&dev->cec_slock);
-               cec_transmit_done(cw->adap, CEC_TX_STATUS_ARB_LOST, 1, 0, 0, 0);
+               cec_transmit_attempt_done(cw->adap, CEC_TX_STATUS_ARB_LOST);
                kfree(cw);
        } else {
                INIT_DELAYED_WORK(&cw->work, vivid_cec_xfer_done_worker);
index 1dfc2de1fe77b93c1a299897b9a3845e86aa4201..c843070f24c13247f6de3c8a0c866895b815e178 100644 (file)
@@ -148,18 +148,15 @@ static void pulse8_irq_work_handler(struct work_struct *work)
                cec_received_msg(pulse8->adap, &pulse8->rx_msg);
                break;
        case MSGCODE_TRANSMIT_SUCCEEDED:
-               cec_transmit_done(pulse8->adap, CEC_TX_STATUS_OK,
-                                 0, 0, 0, 0);
+               cec_transmit_attempt_done(pulse8->adap, CEC_TX_STATUS_OK);
                break;
        case MSGCODE_TRANSMIT_FAILED_ACK:
-               cec_transmit_done(pulse8->adap, CEC_TX_STATUS_NACK,
-                                 0, 1, 0, 0);
+               cec_transmit_attempt_done(pulse8->adap, CEC_TX_STATUS_NACK);
                break;
        case MSGCODE_TRANSMIT_FAILED_LINE:
        case MSGCODE_TRANSMIT_FAILED_TIMEOUT_DATA:
        case MSGCODE_TRANSMIT_FAILED_TIMEOUT_LINE:
-               cec_transmit_done(pulse8->adap, CEC_TX_STATUS_ERROR,
-                                 0, 0, 0, 1);
+               cec_transmit_attempt_done(pulse8->adap, CEC_TX_STATUS_ERROR);
                break;
        }
 }
index ad468efc4399484baa6385f140b4dcff6d7e5575..f203699e9c1bb086dbb5924bb37625244346e3b6 100644 (file)
@@ -98,16 +98,13 @@ static void rain_process_msg(struct rain *rain)
 
        switch (stat) {
        case 1:
-               cec_transmit_done(rain->adap, CEC_TX_STATUS_OK,
-                                 0, 0, 0, 0);
+               cec_transmit_attempt_done(rain->adap, CEC_TX_STATUS_OK);
                break;
        case 2:
-               cec_transmit_done(rain->adap, CEC_TX_STATUS_NACK,
-                                 0, 1, 0, 0);
+               cec_transmit_attempt_done(rain->adap, CEC_TX_STATUS_NACK);
                break;
        default:
-               cec_transmit_done(rain->adap, CEC_TX_STATUS_LOW_DRIVE,
-                                 0, 0, 0, 1);
+               cec_transmit_attempt_done(rain->adap, CEC_TX_STATUS_LOW_DRIVE);
                break;
        }
 }