summaryrefslogtreecommitdiff
path: root/drivers/crypto/inside-secure/safexcel_cipher.c
diff options
context:
space:
mode:
authorAntoine Tenart <antoine.tenart@bootlin.com>2018-05-29 15:13:43 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2018-06-22 18:03:00 +0300
commitcda3e73a54971e38a7388db0132c3681eab87847 (patch)
treec96d6fd94be45c9d4478d3aa1cbc4a653d6e5194 /drivers/crypto/inside-secure/safexcel_cipher.c
parentce43b2e351c860bc50151b3ddc190b92a7536c8e (diff)
downloadlinux-cda3e73a54971e38a7388db0132c3681eab87847.tar.xz
crypto: inside-secure - use the error handler for invalidation requests
This patch reworks the way invalidation request handlers handle the result descriptor errors, to use the common error handling function. This improves the drivers in terms of readability and maintainability. Suggested-by: Ofer Heifetz <oferh@marvell.com> Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/inside-secure/safexcel_cipher.c')
-rw-r--r--drivers/crypto/inside-secure/safexcel_cipher.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/crypto/inside-secure/safexcel_cipher.c b/drivers/crypto/inside-secure/safexcel_cipher.c
index 6bb60fda2043..5bc0afc8e63a 100644
--- a/drivers/crypto/inside-secure/safexcel_cipher.c
+++ b/drivers/crypto/inside-secure/safexcel_cipher.c
@@ -491,11 +491,8 @@ static int safexcel_handle_inv_result(struct safexcel_crypto_priv *priv,
break;
}
- if (rdesc->result_data.error_code) {
- dev_err(priv->dev, "cipher: invalidate: result descriptor error (%d)\n",
- rdesc->result_data.error_code);
- *ret = -EIO;
- }
+ if (likely(!*ret))
+ *ret = safexcel_rdesc_check_errors(priv, rdesc);
ndesc++;
} while (!rdesc->last_seg);