diff options
Diffstat (limited to 'arch/arm/common/locomo.c')
-rw-r--r-- | arch/arm/common/locomo.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index cfe6f4650bc9..ae21755872ed 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c | |||
@@ -60,6 +60,9 @@ struct locomo { | |||
60 | unsigned int irq; | 60 | unsigned int irq; |
61 | spinlock_t lock; | 61 | spinlock_t lock; |
62 | void __iomem *base; | 62 | void __iomem *base; |
63 | #ifdef CONFIG_PM | ||
64 | void *saved_state; | ||
65 | #endif | ||
63 | }; | 66 | }; |
64 | 67 | ||
65 | struct locomo_dev_info { | 68 | struct locomo_dev_info { |
@@ -565,7 +568,7 @@ static int locomo_suspend(struct platform_device *dev, pm_message_t state) | |||
565 | if (!save) | 568 | if (!save) |
566 | return -ENOMEM; | 569 | return -ENOMEM; |
567 | 570 | ||
568 | dev->dev.power.saved_state = (void *) save; | 571 | lchip->saved_state = save; |
569 | 572 | ||
570 | spin_lock_irqsave(&lchip->lock, flags); | 573 | spin_lock_irqsave(&lchip->lock, flags); |
571 | 574 | ||
@@ -605,8 +608,8 @@ static int locomo_resume(struct platform_device *dev) | |||
605 | struct locomo_save_data *save; | 608 | struct locomo_save_data *save; |
606 | unsigned long r; | 609 | unsigned long r; |
607 | unsigned long flags; | 610 | unsigned long flags; |
608 | 611 | ||
609 | save = (struct locomo_save_data *) dev->dev.power.saved_state; | 612 | save = lchip->saved_state; |
610 | if (!save) | 613 | if (!save) |
611 | return 0; | 614 | return 0; |
612 | 615 | ||
@@ -628,6 +631,8 @@ static int locomo_resume(struct platform_device *dev) | |||
628 | locomo_writel(0x1, lchip->base + LOCOMO_KEYBOARD + LOCOMO_KCMD); | 631 | locomo_writel(0x1, lchip->base + LOCOMO_KEYBOARD + LOCOMO_KCMD); |
629 | 632 | ||
630 | spin_unlock_irqrestore(&lchip->lock, flags); | 633 | spin_unlock_irqrestore(&lchip->lock, flags); |
634 | |||
635 | lchip->saved_state = NULL; | ||
631 | kfree(save); | 636 | kfree(save); |
632 | 637 | ||
633 | return 0; | 638 | return 0; |