Commit 95831c6b authored by David Brownell's avatar David Brownell Committed by James Toy

Fix two new-ish runtime warnings in the at91rm9200 (etc) RTC:

 Platform driver 'at91_rtc' needs updating - please use dev_pm_ops
 	... by just switching

 IRQ 1/at91_rtc: IRQF_DISABLED is not guaranteed on shared IRQs
 	... no longer needed now that rtc_update_irq() changed
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Acked-by: default avatarAlessandro Zummo <a.zummo@towertech.it>
Cc: Andrew Victor <linux@maxim.org.za>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 7300aeae
...@@ -289,7 +289,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev) ...@@ -289,7 +289,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
AT91_RTC_CALEV); AT91_RTC_CALEV);
ret = request_irq(AT91_ID_SYS, at91_rtc_interrupt, ret = request_irq(AT91_ID_SYS, at91_rtc_interrupt,
IRQF_DISABLED | IRQF_SHARED, IRQF_SHARED,
"at91_rtc", pdev); "at91_rtc", pdev);
if (ret) { if (ret) {
printk(KERN_ERR "at91_rtc: IRQ %d already in use.\n", printk(KERN_ERR "at91_rtc: IRQ %d already in use.\n",
...@@ -340,7 +340,7 @@ static int __exit at91_rtc_remove(struct platform_device *pdev) ...@@ -340,7 +340,7 @@ static int __exit at91_rtc_remove(struct platform_device *pdev)
static u32 at91_rtc_imr; static u32 at91_rtc_imr;
static int at91_rtc_suspend(struct platform_device *pdev, pm_message_t state) static int at91_rtc_suspend(struct device *dev)
{ {
/* this IRQ is shared with DBGU and other hardware which isn't /* this IRQ is shared with DBGU and other hardware which isn't
* necessarily doing PM like we are... * necessarily doing PM like we are...
...@@ -348,7 +348,7 @@ static int at91_rtc_suspend(struct platform_device *pdev, pm_message_t state) ...@@ -348,7 +348,7 @@ static int at91_rtc_suspend(struct platform_device *pdev, pm_message_t state)
at91_rtc_imr = at91_sys_read(AT91_RTC_IMR) at91_rtc_imr = at91_sys_read(AT91_RTC_IMR)
& (AT91_RTC_ALARM|AT91_RTC_SECEV); & (AT91_RTC_ALARM|AT91_RTC_SECEV);
if (at91_rtc_imr) { if (at91_rtc_imr) {
if (device_may_wakeup(&pdev->dev)) if (device_may_wakeup(dev))
enable_irq_wake(AT91_ID_SYS); enable_irq_wake(AT91_ID_SYS);
else else
at91_sys_write(AT91_RTC_IDR, at91_rtc_imr); at91_sys_write(AT91_RTC_IDR, at91_rtc_imr);
...@@ -356,28 +356,34 @@ static int at91_rtc_suspend(struct platform_device *pdev, pm_message_t state) ...@@ -356,28 +356,34 @@ static int at91_rtc_suspend(struct platform_device *pdev, pm_message_t state)
return 0; return 0;
} }
static int at91_rtc_resume(struct platform_device *pdev) static int at91_rtc_resume(struct device *dev)
{ {
if (at91_rtc_imr) { if (at91_rtc_imr) {
if (device_may_wakeup(&pdev->dev)) if (device_may_wakeup(dev))
disable_irq_wake(AT91_ID_SYS); disable_irq_wake(AT91_ID_SYS);
else else
at91_sys_write(AT91_RTC_IER, at91_rtc_imr); at91_sys_write(AT91_RTC_IER, at91_rtc_imr);
} }
return 0; return 0;
} }
static const struct dev_pm_ops at91_rtc_pm = {
.suspend = at91_rtc_suspend,
.resume = at91_rtc_resume,
};
#define at91_rtc_pm_ptr &at91_rtc_pm
#else #else
#define at91_rtc_suspend NULL #define at91_rtc_pm_ptr NULL
#define at91_rtc_resume NULL
#endif #endif
static struct platform_driver at91_rtc_driver = { static struct platform_driver at91_rtc_driver = {
.remove = __exit_p(at91_rtc_remove), .remove = __exit_p(at91_rtc_remove),
.suspend = at91_rtc_suspend,
.resume = at91_rtc_resume,
.driver = { .driver = {
.name = "at91_rtc", .name = "at91_rtc",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = at91_rtc_pm_ptr,
}, },
}; };
......
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