All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] backports: backport ACPI_HANDLE(dev)
@ 2014-02-11  6:40 Emmanuel Grumbach
  2014-02-12 11:10 ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Emmanuel Grumbach @ 2014-02-11  6:40 UTC (permalink / raw)
  To: backports; +Cc: Ido Yariv, Ido Yariv, Emmanuel Grumbach

From: Ido Yariv <ido@wizery.com>

Depending on the kernel version it might either be defined in
linux/device.h or not at all, in which case DEVICE_ACPI_HANDLE is used
instead.

ACPI_HANDLE(dev) will be used by iwlwifi very soon.

Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 backport/backport-include/linux/acpi.h | 40 ++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 backport/backport-include/linux/acpi.h

diff --git a/backport/backport-include/linux/acpi.h b/backport/backport-include/linux/acpi.h
new file mode 100644
index 0000000..8a79143
--- /dev/null
+++ b/backport/backport-include/linux/acpi.h
@@ -0,0 +1,40 @@
+#ifndef __BACKPORT_LINUX_ACPI_H
+#define __BACKPORT_LINUX_ACPI_H
+#include_next <linux/acpi.h>
+#include_next <linux/device.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0)
+/*
+ * Backports
+ *
+ * commit 95f8a082b9b1ead0c2859f2a7b1ac91ff63d8765
+ * Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+ * Date:   Wed Nov 21 00:21:50 2012 +0100
+ *
+ *     ACPI / driver core: Introduce struct acpi_dev_node and related macros
+ *
+ *     To avoid adding an ACPI handle pointer to struct device on
+ *     architectures that don't use ACPI, or generally when CONFIG_ACPI is
+ *     not set, in which cases that pointer is useless, define struct
+ *     acpi_dev_node that will contain the handle pointer if CONFIG_ACPI is
+ *     set and will be empty otherwise and use it to represent the ACPI
+ *     device node field in struct device.
+ *
+ *     In addition to that define macros for reading and setting the ACPI
+ *     handle of a device that don't generate code when CONFIG_ACPI is
+ *     unset.  Modify the ACPI subsystem to use those macros instead of
+ *     referring to the given device's ACPI handle directly.
+ *
+ *     Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+ *     Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
+ *     Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+ */
+#ifdef CONFIG_ACPI
+#define ACPI_HANDLE(dev) DEVICE_ACPI_HANDLE(dev)
+#else
+#define ACPI_HANDLE(dev) (NULL)
+#endif /* CONFIG_ACPI */
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0) */
+
+#endif /* __BACKPORT_LINUX_ACPI_H */
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-13 18:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-11  6:40 [PATCH] backports: backport ACPI_HANDLE(dev) Emmanuel Grumbach
2014-02-12 11:10 ` Johannes Berg
2014-02-12 23:44   ` Ido Yariv
2014-02-13  7:44     ` Johannes Berg
2014-02-13 18:28       ` [PATCH v2] " Ido Yariv

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.