* [PATCH] backport: add pm_runtime_active() implementation for < 3.9 kernels
@ 2016-04-19 19:13 Luca Coelho
2016-05-06 21:29 ` Hauke Mehrtens
0 siblings, 1 reply; 2+ messages in thread
From: Luca Coelho @ 2016-04-19 19:13 UTC (permalink / raw)
To: backports
From: Luca Coelho <luciano.coelho@intel.com>
The pm_runtime_active() helper function was introduced in kernel 3.9.
In order to use it in earlier kernels, we need to add its
implementation to the backports.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
backport/backport-include/linux/pm_runtime.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
create mode 100644 backport/backport-include/linux/pm_runtime.h
diff --git a/backport/backport-include/linux/pm_runtime.h b/backport/backport-include/linux/pm_runtime.h
new file mode 100644
index 0000000..bc0b109
--- /dev/null
+++ b/backport/backport-include/linux/pm_runtime.h
@@ -0,0 +1,19 @@
+#ifndef __BACKPORT_PM_RUNTIME_H
+#define __BACKPORT_PM_RUNTIME_H
+#include_next <linux/pm_runtime.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)
+
+#ifdef CONFIG_PM
+static inline bool pm_runtime_active(struct device *dev)
+{
+ return dev->power.runtime_status == RPM_ACTIVE
+ || dev->power.disable_depth;
+}
+#else
+static inline bool pm_runtime_active(struct device *dev) { return true; }
+#endif /* CONFIG_PM */
+
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) */
+
+#endif /* __BACKPORT_PM_RUNTIME_H */
--
2.8.0.rc3
--
To unsubscribe from this list: send the line "unsubscribe backports" in
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] backport: add pm_runtime_active() implementation for < 3.9 kernels
2016-04-19 19:13 [PATCH] backport: add pm_runtime_active() implementation for < 3.9 kernels Luca Coelho
@ 2016-05-06 21:29 ` Hauke Mehrtens
0 siblings, 0 replies; 2+ messages in thread
From: Hauke Mehrtens @ 2016-05-06 21:29 UTC (permalink / raw)
To: Luca Coelho, backports
On 04/19/2016 09:13 PM, Luca Coelho wrote:
> From: Luca Coelho <luciano.coelho@intel.com>
>
> The pm_runtime_active() helper function was introduced in kernel 3.9.
> In order to use it in earlier kernels, we need to add its
> implementation to the backports.
>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
> backport/backport-include/linux/pm_runtime.h | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
> create mode 100644 backport/backport-include/linux/pm_runtime.h
>
Thank you for the patch, it was applied with a minor modification.
Hauke
--
To unsubscribe from this list: send the line "unsubscribe backports" in
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-06 21:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-19 19:13 [PATCH] backport: add pm_runtime_active() implementation for < 3.9 kernels Luca Coelho
2016-05-06 21:29 ` Hauke Mehrtens
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.