Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[linux-2.6-microblaze.git] / drivers / crypto / stm32 / stm32-hash.c
index 4835dd4..4ca4a26 100644 (file)
@@ -895,7 +895,6 @@ static int stm32_hash_enqueue(struct ahash_request *req, unsigned int op)
 static int stm32_hash_update(struct ahash_request *req)
 {
        struct stm32_hash_request_ctx *rctx = ahash_request_ctx(req);
-       int ret;
 
        if (!req->nbytes || !(rctx->flags & HASH_FLAGS_CPU))
                return 0;
@@ -909,12 +908,7 @@ static int stm32_hash_update(struct ahash_request *req)
                return 0;
        }
 
-       ret = stm32_hash_enqueue(req, HASH_OP_UPDATE);
-
-       if (rctx->flags & HASH_FLAGS_FINUP)
-               return ret;
-
-       return 0;
+       return stm32_hash_enqueue(req, HASH_OP_UPDATE);
 }
 
 static int stm32_hash_final(struct ahash_request *req)
@@ -1070,7 +1064,6 @@ static int stm32_hash_cra_sha256_init(struct crypto_tfm *tfm)
 static irqreturn_t stm32_hash_irq_thread(int irq, void *dev_id)
 {
        struct stm32_hash_dev *hdev = dev_id;
-       int err;
 
        if (HASH_FLAGS_CPU & hdev->flags) {
                if (HASH_FLAGS_OUTPUT_READY & hdev->flags) {
@@ -1087,8 +1080,8 @@ static irqreturn_t stm32_hash_irq_thread(int irq, void *dev_id)
        return IRQ_HANDLED;
 
 finish:
-       /*Finish current request */
-       stm32_hash_finish_req(hdev->req, err);
+       /* Finish current request */
+       stm32_hash_finish_req(hdev->req, 0);
 
        return IRQ_HANDLED;
 }
@@ -1411,11 +1404,10 @@ MODULE_DEVICE_TABLE(of, stm32_hash_of_match);
 static int stm32_hash_get_of_match(struct stm32_hash_dev *hdev,
                                   struct device *dev)
 {
-       const struct of_device_id *match;
        int err;
 
-       match = of_match_device(stm32_hash_of_match, dev);
-       if (!match) {
+       hdev->pdata = of_device_get_match_data(dev);
+       if (!hdev->pdata) {
                dev_err(dev, "no compatible OF match\n");
                return -EINVAL;
        }
@@ -1423,8 +1415,6 @@ static int stm32_hash_get_of_match(struct stm32_hash_dev *hdev,
        err = of_property_read_u32(dev->of_node, "dma-maxburst",
                                   &hdev->dma_maxburst);
 
-       hdev->pdata = match->data;
-
        return err;
 }