diff mbox series

[v2,14/14] crypto: caam - change return value in case CAAM has no MDHA

Message ID 1563494276-3993-15-git-send-email-iuliana.prodan@nxp.com (mailing list archive)
State Superseded
Delegated to: Herbert Xu
Headers show
Series crypto: caam - fixes for kernel v5.3 | expand

Commit Message

Iuliana Prodan July 18, 2019, 11:57 p.m. UTC
To be consistent with other CAAM modules, caamhash should return 0
instead of -ENODEV in case CAAM has no MDHA.

Based on commit 1b46c90c8e00 ("crypto: caam - convert top level drivers to libraries")
the value returned by entry point is never checked and
the exit point is always executed.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
---
 drivers/crypto/caam/caamhash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Horia Geanta July 19, 2019, 4:26 p.m. UTC | #1
On 7/19/2019 2:58 AM, Iuliana Prodan wrote:
> To be consistent with other CAAM modules, caamhash should return 0
> instead of -ENODEV in case CAAM has no MDHA.
> 
> Based on commit 1b46c90c8e00 ("crypto: caam - convert top level drivers to libraries")
> the value returned by entry point is never checked and
> the exit point is always executed.
> 
> Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>

Horia
diff mbox series

Patch

diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c
index e89913b..d4e047f 100644
--- a/drivers/crypto/caam/caamhash.c
+++ b/drivers/crypto/caam/caamhash.c
@@ -2008,7 +2008,7 @@  int caam_algapi_hash_init(struct device *ctrldev)
 	 * is not present.
 	 */
 	if (!md_inst)
-		return -ENODEV;
+		return 0;
 
 	/* Limit digest size based on LP256 */
 	if (md_vid == CHA_VER_VID_MD_LP256)