ccp_dev_suspend and ccp_dev_resume return 0 on error, which causes ret to equal 0 in sp_suspend and sp_resume, making the if condition impossible to use.
Signed-off-by: Tian Tao <tiant...@hisilicon.com> --- drivers/crypto/ccp/ccp-dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ccp/ccp-dev.c b/drivers/crypto/ccp/ccp-dev.c index 0971ee6..6f2af7b 100644 --- a/drivers/crypto/ccp/ccp-dev.c +++ b/drivers/crypto/ccp/ccp-dev.c @@ -556,7 +556,7 @@ int ccp_dev_suspend(struct sp_device *sp) /* If there's no device there's nothing to do */ if (!ccp) - return 0; + return -ENXIO; spin_lock_irqsave(&ccp->cmd_lock, flags); @@ -584,7 +584,7 @@ int ccp_dev_resume(struct sp_device *sp) /* If there's no device there's nothing to do */ if (!ccp) - return 0; + return -ENXIO; spin_lock_irqsave(&ccp->cmd_lock, flags); -- 2.7.4