Commit 8b0c4366 authored by Gilad Ben-Yossef's avatar Gilad Ben-Yossef Committed by Herbert Xu

crypto: ccree - cc_do_send_request() is void func

cc_do_send_request() cannot fail and always returns
-EINPROGRESS. Turn it into a void function and simplify
code.
Signed-off-by: default avatarGilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent cedca59f
...@@ -275,12 +275,11 @@ static int cc_queues_status(struct cc_drvdata *drvdata, ...@@ -275,12 +275,11 @@ static int cc_queues_status(struct cc_drvdata *drvdata,
* \param len The crypto sequence length * \param len The crypto sequence length
* \param add_comp If "true": add an artificial dout DMA to mark completion * \param add_comp If "true": add an artificial dout DMA to mark completion
* *
* \return int Returns -EINPROGRESS or error code
*/ */
static int cc_do_send_request(struct cc_drvdata *drvdata, static void cc_do_send_request(struct cc_drvdata *drvdata,
struct cc_crypto_req *cc_req, struct cc_crypto_req *cc_req,
struct cc_hw_desc *desc, unsigned int len, struct cc_hw_desc *desc, unsigned int len,
bool add_comp) bool add_comp)
{ {
struct cc_req_mgr_handle *req_mgr_h = drvdata->request_mgr_handle; struct cc_req_mgr_handle *req_mgr_h = drvdata->request_mgr_handle;
unsigned int used_sw_slots; unsigned int used_sw_slots;
...@@ -328,9 +327,6 @@ static int cc_do_send_request(struct cc_drvdata *drvdata, ...@@ -328,9 +327,6 @@ static int cc_do_send_request(struct cc_drvdata *drvdata,
/* Update the free slots in HW queue */ /* Update the free slots in HW queue */
req_mgr_h->q_free_slots -= total_seq_len; req_mgr_h->q_free_slots -= total_seq_len;
} }
/* Operation still in process */
return -EINPROGRESS;
} }
static void cc_enqueue_backlog(struct cc_drvdata *drvdata, static void cc_enqueue_backlog(struct cc_drvdata *drvdata,
...@@ -390,16 +386,10 @@ static void cc_proc_backlog(struct cc_drvdata *drvdata) ...@@ -390,16 +386,10 @@ static void cc_proc_backlog(struct cc_drvdata *drvdata)
return; return;
} }
rc = cc_do_send_request(drvdata, &bli->creq, bli->desc, cc_do_send_request(drvdata, &bli->creq, bli->desc, bli->len,
bli->len, false); false);
spin_unlock(&mgr->hw_lock); spin_unlock(&mgr->hw_lock);
if (rc != -EINPROGRESS) {
cc_pm_put_suspend(dev);
creq->user_cb(dev, req, rc);
}
/* Remove ourselves from the backlog list */ /* Remove ourselves from the backlog list */
spin_lock(&mgr->bl_lock); spin_lock(&mgr->bl_lock);
list_del(&bli->list); list_del(&bli->list);
...@@ -452,8 +442,10 @@ int cc_send_request(struct cc_drvdata *drvdata, struct cc_crypto_req *cc_req, ...@@ -452,8 +442,10 @@ int cc_send_request(struct cc_drvdata *drvdata, struct cc_crypto_req *cc_req,
return -EBUSY; return -EBUSY;
} }
if (!rc) if (!rc) {
rc = cc_do_send_request(drvdata, cc_req, desc, len, false); cc_do_send_request(drvdata, cc_req, desc, len, false);
rc = -EINPROGRESS;
}
spin_unlock_bh(&mgr->hw_lock); spin_unlock_bh(&mgr->hw_lock);
return rc; return rc;
...@@ -493,14 +485,8 @@ int cc_send_sync_request(struct cc_drvdata *drvdata, ...@@ -493,14 +485,8 @@ int cc_send_sync_request(struct cc_drvdata *drvdata,
reinit_completion(&drvdata->hw_queue_avail); reinit_completion(&drvdata->hw_queue_avail);
} }
rc = cc_do_send_request(drvdata, cc_req, desc, len, true); cc_do_send_request(drvdata, cc_req, desc, len, true);
spin_unlock_bh(&mgr->hw_lock); spin_unlock_bh(&mgr->hw_lock);
if (rc != -EINPROGRESS) {
cc_pm_put_suspend(dev);
return rc;
}
wait_for_completion(&cc_req->seq_compl); wait_for_completion(&cc_req->seq_compl);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment