Commit 5d17c414 authored by Tian Tao's avatar Tian Tao Committed by Herbert Xu

crypto: ccp - Make ccp_dev_suspend and ccp_dev_resume void functions

Since ccp_dev_suspend() and ccp_dev_resume() only return 0 which causes
ret to equal 0 in sp_suspend and sp_resume, making the if condition
impossible to use. it might be a more appropriate fix to have these be
void functions and eliminate the if condition in sp_suspend() and
sp_resume().
Signed-off-by: default avatarTian Tao <tiantao6@hisilicon.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Acked-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Acked-by: default avatarJohn Allen <john.allen@amd.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent b2d17df3
...@@ -548,7 +548,7 @@ bool ccp_queues_suspended(struct ccp_device *ccp) ...@@ -548,7 +548,7 @@ bool ccp_queues_suspended(struct ccp_device *ccp)
return ccp->cmd_q_count == suspended; return ccp->cmd_q_count == suspended;
} }
int ccp_dev_suspend(struct sp_device *sp) void ccp_dev_suspend(struct sp_device *sp)
{ {
struct ccp_device *ccp = sp->ccp_data; struct ccp_device *ccp = sp->ccp_data;
unsigned long flags; unsigned long flags;
...@@ -556,7 +556,7 @@ int ccp_dev_suspend(struct sp_device *sp) ...@@ -556,7 +556,7 @@ int ccp_dev_suspend(struct sp_device *sp)
/* If there's no device there's nothing to do */ /* If there's no device there's nothing to do */
if (!ccp) if (!ccp)
return 0; return;
spin_lock_irqsave(&ccp->cmd_lock, flags); spin_lock_irqsave(&ccp->cmd_lock, flags);
...@@ -572,11 +572,9 @@ int ccp_dev_suspend(struct sp_device *sp) ...@@ -572,11 +572,9 @@ int ccp_dev_suspend(struct sp_device *sp)
while (!ccp_queues_suspended(ccp)) while (!ccp_queues_suspended(ccp))
wait_event_interruptible(ccp->suspend_queue, wait_event_interruptible(ccp->suspend_queue,
ccp_queues_suspended(ccp)); ccp_queues_suspended(ccp));
return 0;
} }
int ccp_dev_resume(struct sp_device *sp) void ccp_dev_resume(struct sp_device *sp)
{ {
struct ccp_device *ccp = sp->ccp_data; struct ccp_device *ccp = sp->ccp_data;
unsigned long flags; unsigned long flags;
...@@ -584,7 +582,7 @@ int ccp_dev_resume(struct sp_device *sp) ...@@ -584,7 +582,7 @@ int ccp_dev_resume(struct sp_device *sp)
/* If there's no device there's nothing to do */ /* If there's no device there's nothing to do */
if (!ccp) if (!ccp)
return 0; return;
spin_lock_irqsave(&ccp->cmd_lock, flags); spin_lock_irqsave(&ccp->cmd_lock, flags);
...@@ -597,8 +595,6 @@ int ccp_dev_resume(struct sp_device *sp) ...@@ -597,8 +595,6 @@ int ccp_dev_resume(struct sp_device *sp)
} }
spin_unlock_irqrestore(&ccp->cmd_lock, flags); spin_unlock_irqrestore(&ccp->cmd_lock, flags);
return 0;
} }
int ccp_dev_init(struct sp_device *sp) int ccp_dev_init(struct sp_device *sp)
......
...@@ -213,12 +213,8 @@ void sp_destroy(struct sp_device *sp) ...@@ -213,12 +213,8 @@ void sp_destroy(struct sp_device *sp)
int sp_suspend(struct sp_device *sp) int sp_suspend(struct sp_device *sp)
{ {
int ret;
if (sp->dev_vdata->ccp_vdata) { if (sp->dev_vdata->ccp_vdata) {
ret = ccp_dev_suspend(sp); ccp_dev_suspend(sp);
if (ret)
return ret;
} }
return 0; return 0;
...@@ -226,12 +222,8 @@ int sp_suspend(struct sp_device *sp) ...@@ -226,12 +222,8 @@ int sp_suspend(struct sp_device *sp)
int sp_resume(struct sp_device *sp) int sp_resume(struct sp_device *sp)
{ {
int ret;
if (sp->dev_vdata->ccp_vdata) { if (sp->dev_vdata->ccp_vdata) {
ret = ccp_dev_resume(sp); ccp_dev_resume(sp);
if (ret)
return ret;
} }
return 0; return 0;
......
...@@ -134,8 +134,8 @@ struct sp_device *sp_get_psp_master_device(void); ...@@ -134,8 +134,8 @@ struct sp_device *sp_get_psp_master_device(void);
int ccp_dev_init(struct sp_device *sp); int ccp_dev_init(struct sp_device *sp);
void ccp_dev_destroy(struct sp_device *sp); void ccp_dev_destroy(struct sp_device *sp);
int ccp_dev_suspend(struct sp_device *sp); void ccp_dev_suspend(struct sp_device *sp);
int ccp_dev_resume(struct sp_device *sp); void ccp_dev_resume(struct sp_device *sp);
#else /* !CONFIG_CRYPTO_DEV_SP_CCP */ #else /* !CONFIG_CRYPTO_DEV_SP_CCP */
...@@ -144,15 +144,8 @@ static inline int ccp_dev_init(struct sp_device *sp) ...@@ -144,15 +144,8 @@ static inline int ccp_dev_init(struct sp_device *sp)
return 0; return 0;
} }
static inline void ccp_dev_destroy(struct sp_device *sp) { } static inline void ccp_dev_destroy(struct sp_device *sp) { }
static inline void ccp_dev_suspend(struct sp_device *sp) { }
static inline int ccp_dev_suspend(struct sp_device *sp) static inline void ccp_dev_resume(struct sp_device *sp) { }
{
return 0;
}
static inline int ccp_dev_resume(struct sp_device *sp)
{
return 0;
}
#endif /* CONFIG_CRYPTO_DEV_SP_CCP */ #endif /* CONFIG_CRYPTO_DEV_SP_CCP */
#ifdef CONFIG_CRYPTO_DEV_SP_PSP #ifdef CONFIG_CRYPTO_DEV_SP_PSP
......
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