diff options
author | Sudeep Holla <Sudeep.Holla@arm.com> | 2015-09-21 11:47:02 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2015-11-08 08:12:25 -0500 |
commit | caff0cc419d764287675e55bb46405c6e1fe43ee (patch) | |
tree | 9f498970ff6c39904bfca0db8bad981f635c4db4 /drivers/rtc | |
parent | 93a6f9168f2fbeb5bb000ba079e17a11bedc1a62 (diff) |
rtc: ds1343: remove misuse of IRQF_NO_SUSPEND flag
The IRQF_NO_SUSPEND flag is used to identify the interrupts that should
be left enabled so as to allow them to work as expected during the
suspend-resume cycle, but doesn't guarantee that it will wake the system
from a suspended state, enable_irq_wake is recommended to be used for
the wakeup.
This patch removes the use of IRQF_NO_SUSPEND flags and uses newly
introduce PM wakeup APIs dev_pm_{set,clear}_wake_irq.
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: rtc-linux@googlegroups.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-ds1343.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-ds1343.c b/drivers/rtc/rtc-ds1343.c index 79a06dd3c185..615ce5c370eb 100644 --- a/drivers/rtc/rtc-ds1343.c +++ b/drivers/rtc/rtc-ds1343.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/rtc.h> | 21 | #include <linux/rtc.h> |
22 | #include <linux/bcd.h> | 22 | #include <linux/bcd.h> |
23 | #include <linux/pm.h> | 23 | #include <linux/pm.h> |
24 | #include <linux/pm_wakeirq.h> | ||
24 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
25 | 26 | ||
26 | #define DS1343_DRV_VERSION "01.00" | 27 | #define DS1343_DRV_VERSION "01.00" |
@@ -663,15 +664,15 @@ static int ds1343_probe(struct spi_device *spi) | |||
663 | 664 | ||
664 | if (priv->irq >= 0) { | 665 | if (priv->irq >= 0) { |
665 | res = devm_request_threaded_irq(&spi->dev, spi->irq, NULL, | 666 | res = devm_request_threaded_irq(&spi->dev, spi->irq, NULL, |
666 | ds1343_thread, | 667 | ds1343_thread, IRQF_ONESHOT, |
667 | IRQF_NO_SUSPEND | IRQF_ONESHOT, | ||
668 | "ds1343", priv); | 668 | "ds1343", priv); |
669 | if (res) { | 669 | if (res) { |
670 | priv->irq = -1; | 670 | priv->irq = -1; |
671 | dev_err(&spi->dev, | 671 | dev_err(&spi->dev, |
672 | "unable to request irq for rtc ds1343\n"); | 672 | "unable to request irq for rtc ds1343\n"); |
673 | } else { | 673 | } else { |
674 | device_set_wakeup_capable(&spi->dev, 1); | 674 | device_init_wakeup(&spi->dev, true); |
675 | dev_pm_set_wake_irq(&spi->dev, spi->irq); | ||
675 | } | 676 | } |
676 | } | 677 | } |
677 | 678 | ||
@@ -692,6 +693,8 @@ static int ds1343_remove(struct spi_device *spi) | |||
692 | priv->irqen &= ~RTC_AF; | 693 | priv->irqen &= ~RTC_AF; |
693 | mutex_unlock(&priv->mutex); | 694 | mutex_unlock(&priv->mutex); |
694 | 695 | ||
696 | dev_pm_clear_wake_irq(&spi->dev); | ||
697 | device_init_wakeup(&spi->dev, false); | ||
695 | devm_free_irq(&spi->dev, spi->irq, priv); | 698 | devm_free_irq(&spi->dev, spi->irq, priv); |
696 | } | 699 | } |
697 | 700 | ||