diff options
Diffstat (limited to 'drivers/crypto/ccp/ccp-dev.c')
-rw-r--r-- | drivers/crypto/ccp/ccp-dev.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/crypto/ccp/ccp-dev.c b/drivers/crypto/ccp/ccp-dev.c index f79eede71c62..edefa669153f 100644 --- a/drivers/crypto/ccp/ccp-dev.c +++ b/drivers/crypto/ccp/ccp-dev.c | |||
@@ -540,6 +540,10 @@ int ccp_dev_suspend(struct sp_device *sp, pm_message_t state) | |||
540 | unsigned long flags; | 540 | unsigned long flags; |
541 | unsigned int i; | 541 | unsigned int i; |
542 | 542 | ||
543 | /* If there's no device there's nothing to do */ | ||
544 | if (!ccp) | ||
545 | return 0; | ||
546 | |||
543 | spin_lock_irqsave(&ccp->cmd_lock, flags); | 547 | spin_lock_irqsave(&ccp->cmd_lock, flags); |
544 | 548 | ||
545 | ccp->suspending = 1; | 549 | ccp->suspending = 1; |
@@ -564,6 +568,10 @@ int ccp_dev_resume(struct sp_device *sp) | |||
564 | unsigned long flags; | 568 | unsigned long flags; |
565 | unsigned int i; | 569 | unsigned int i; |
566 | 570 | ||
571 | /* If there's no device there's nothing to do */ | ||
572 | if (!ccp) | ||
573 | return 0; | ||
574 | |||
567 | spin_lock_irqsave(&ccp->cmd_lock, flags); | 575 | spin_lock_irqsave(&ccp->cmd_lock, flags); |
568 | 576 | ||
569 | ccp->suspending = 0; | 577 | ccp->suspending = 0; |