Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sudeep Holla and committed by
Alexandre Belloni
caff0cc4 93a6f916

+6 -3
+6 -3
drivers/rtc/rtc-ds1343.c
··· 21 21 #include <linux/rtc.h> 22 22 #include <linux/bcd.h> 23 23 #include <linux/pm.h> 24 + #include <linux/pm_wakeirq.h> 24 25 #include <linux/slab.h> 25 26 26 27 #define DS1343_DRV_VERSION "01.00" ··· 664 663 665 664 if (priv->irq >= 0) { 666 665 res = devm_request_threaded_irq(&spi->dev, spi->irq, NULL, 667 - ds1343_thread, 668 - IRQF_NO_SUSPEND | IRQF_ONESHOT, 666 + ds1343_thread, IRQF_ONESHOT, 669 667 "ds1343", priv); 670 668 if (res) { 671 669 priv->irq = -1; 672 670 dev_err(&spi->dev, 673 671 "unable to request irq for rtc ds1343\n"); 674 672 } else { 675 - device_set_wakeup_capable(&spi->dev, 1); 673 + device_init_wakeup(&spi->dev, true); 674 + dev_pm_set_wake_irq(&spi->dev, spi->irq); 676 675 } 677 676 } 678 677 ··· 693 692 priv->irqen &= ~RTC_AF; 694 693 mutex_unlock(&priv->mutex); 695 694 695 + dev_pm_clear_wake_irq(&spi->dev); 696 + device_init_wakeup(&spi->dev, false); 696 697 devm_free_irq(&spi->dev, spi->irq, priv); 697 698 } 698 699