summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-lpc32xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-lpc32xx.c')
-rw-r--r--drivers/rtc/rtc-lpc32xx.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/rtc/rtc-lpc32xx.c b/drivers/rtc/rtc-lpc32xx.c
index 3ba87239aacc..910e600275b9 100644
--- a/drivers/rtc/rtc-lpc32xx.c
+++ b/drivers/rtc/rtc-lpc32xx.c
@@ -294,11 +294,10 @@ static int lpc32xx_rtc_remove(struct platform_device *pdev)
#ifdef CONFIG_PM
static int lpc32xx_rtc_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct lpc32xx_rtc *rtc = platform_get_drvdata(pdev);
+ struct lpc32xx_rtc *rtc = dev_get_drvdata(dev);
if (rtc->irq >= 0) {
- if (device_may_wakeup(&pdev->dev))
+ if (device_may_wakeup(dev))
enable_irq_wake(rtc->irq);
else
disable_irq_wake(rtc->irq);
@@ -309,10 +308,9 @@ static int lpc32xx_rtc_suspend(struct device *dev)
static int lpc32xx_rtc_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct lpc32xx_rtc *rtc = platform_get_drvdata(pdev);
+ struct lpc32xx_rtc *rtc = dev_get_drvdata(dev);
- if (rtc->irq >= 0 && device_may_wakeup(&pdev->dev))
+ if (rtc->irq >= 0 && device_may_wakeup(dev))
disable_irq_wake(rtc->irq);
return 0;
@@ -321,8 +319,7 @@ static int lpc32xx_rtc_resume(struct device *dev)
/* Unconditionally disable the alarm */
static int lpc32xx_rtc_freeze(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct lpc32xx_rtc *rtc = platform_get_drvdata(pdev);
+ struct lpc32xx_rtc *rtc = dev_get_drvdata(dev);
spin_lock_irq(&rtc->lock);
@@ -337,8 +334,7 @@ static int lpc32xx_rtc_freeze(struct device *dev)
static int lpc32xx_rtc_thaw(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct lpc32xx_rtc *rtc = platform_get_drvdata(pdev);
+ struct lpc32xx_rtc *rtc = dev_get_drvdata(dev);
if (rtc->alarm_enabled) {
spin_lock_irq(&rtc->lock);