]> Pileus Git - ~andy/linux/commitdiff
ACPI / i915: Fix incorrect <acpi/acpi.h> inclusions via <linux/acpi_io.h>
authorLv Zheng <lv.zheng@intel.com>
Fri, 6 Dec 2013 08:52:05 +0000 (16:52 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 7 Dec 2013 00:24:33 +0000 (01:24 +0100)
To avoid build problems and breaking dependencies between ACPI header
files, <acpi/acpi.h> should not be included directly by code outside
of the ACPI core subsystem.  However, that is possible if
<linux/acpi_io.h> is included, because that file contains
a direct inclusion of <acpi/acpi.h>.

For this reason, remove the direct <acpi/acpi.h> inclusion from
<linux/acpi_io.h>, move that file from include/linux/ to include/acpi/
and make <linux/acpi.h> include it for CONFIG_ACPI set along with the
other ACPI header files.  Accordingly, Remove the inclusions of
<linux/acpi_io.h> from everywhere.

Of course, that causes the contents of the new <acpi/acpi_io.h> file
to be available for CONFIG_ACPI set only, so intel_opregion.o that
depends on it should also depend on CONFIG_ACPI (and it really should
not be compiled for CONFIG_ACPI unset anyway).

References: https://01.org/linuxgraphics/sites/default/files/documentation/acpi_igd_opregion_spec.pdf
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[rjw: Subject and changelog]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/apei/apei-base.c
drivers/acpi/apei/apei-internal.h
drivers/acpi/apei/ghes.c
drivers/acpi/nvs.c
drivers/acpi/osl.c
drivers/gpu/drm/gma500/opregion.c
drivers/gpu/drm/i915/Makefile
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_opregion.c
include/acpi/acpi_io.h [moved from include/linux/acpi_io.h with 87% similarity]
include/linux/acpi.h

index 6d2c49b86b7fa82434bdb0b2ce1906c95dce00ca..0760b75f79cc0a6c9c75ab627197f98c55eed268 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/acpi.h>
-#include <linux/acpi_io.h>
 #include <linux/slab.h>
 #include <linux/io.h>
 #include <linux/kref.h>
index 21ba34a73883d4cad91406659bbe27f80b788bdb..e5bcd919d4e6922d9fc7b87d42d949adb07826cf 100644 (file)
@@ -8,7 +8,6 @@
 
 #include <linux/cper.h>
 #include <linux/acpi.h>
-#include <linux/acpi_io.h>
 
 struct apei_exec_context;
 
index a30bc313787be65523797da950f3982e13844c35..694c486a12ed1589456d897cd18218595800ecf3 100644 (file)
@@ -33,7 +33,6 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/acpi.h>
-#include <linux/acpi_io.h>
 #include <linux/io.h>
 #include <linux/interrupt.h>
 #include <linux/timer.h>
index 386a9fe497b451d0da6ebed2bc4b6f1a2dacda71..ef28613d51927043a0d567b353a6ef85a0ac32d8 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/acpi.h>
-#include <linux/acpi_io.h>
 
 /* ACPI NVS regions, APEI may use it */
 
index 244be2affea781426740122e38420c87433a3f76..064b8b365060d81ad84c6db7ab872f9df11f4cba 100644 (file)
@@ -39,7 +39,6 @@
 #include <linux/workqueue.h>
 #include <linux/nmi.h>
 #include <linux/acpi.h>
-#include <linux/acpi_io.h>
 #include <linux/efi.h>
 #include <linux/ioport.h>
 #include <linux/list.h>
index ad0d6de938f3654aae0ccef2f02ba2d4abb6a1ef..13ec6283bf597481e83089226ed13dfc35fbc37f 100644 (file)
@@ -22,7 +22,6 @@
  *
  */
 #include <linux/acpi.h>
-#include <linux/acpi_io.h>
 #include "psb_drv.h"
 #include "psb_intel_reg.h"
 
index 41838eaa799c5afcb7510bae31118099d4d848a3..d4ae48b04cf2b127630e309192cce4c05509cbf4 100644 (file)
@@ -38,7 +38,6 @@ i915-y := i915_drv.o i915_dma.o i915_irq.o \
          intel_ringbuffer.o \
          intel_overlay.o \
          intel_sprite.o \
-         intel_opregion.o \
          intel_sideband.o \
          intel_uncore.o \
          dvo_ch7xxx.o \
@@ -51,7 +50,7 @@ i915-y := i915_drv.o i915_dma.o i915_irq.o \
 
 i915-$(CONFIG_COMPAT)   += i915_ioc32.o
 
-i915-$(CONFIG_ACPI)    += intel_acpi.o
+i915-$(CONFIG_ACPI)    += intel_acpi.o intel_opregion.o
 
 i915-$(CONFIG_DRM_I915_FBDEV) += intel_fbdev.o
 
index ccdbecca070d2340919d5499f80824ddb84db4ac..7f37b838802e9618d52cb798cfb3185e67692332 100644 (file)
@@ -2336,8 +2336,8 @@ extern void intel_i2c_reset(struct drm_device *dev);
 
 /* intel_opregion.c */
 struct intel_encoder;
-extern int intel_opregion_setup(struct drm_device *dev);
 #ifdef CONFIG_ACPI
+extern int intel_opregion_setup(struct drm_device *dev);
 extern void intel_opregion_init(struct drm_device *dev);
 extern void intel_opregion_fini(struct drm_device *dev);
 extern void intel_opregion_asle_intr(struct drm_device *dev);
@@ -2346,6 +2346,7 @@ extern int intel_opregion_notify_encoder(struct intel_encoder *intel_encoder,
 extern int intel_opregion_notify_adapter(struct drm_device *dev,
                                         pci_power_t state);
 #else
+static inline int intel_opregion_setup(struct drm_device *dev) { return 0; }
 static inline void intel_opregion_init(struct drm_device *dev) { return; }
 static inline void intel_opregion_fini(struct drm_device *dev) { return; }
 static inline void intel_opregion_asle_intr(struct drm_device *dev) { return; }
index 6d69a9bad86545c6a8cfc8e8ff86480d462c2132..9a8804bee5cdfd08276592672d35d83e564fc9ef 100644 (file)
@@ -28,7 +28,6 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/acpi.h>
-#include <linux/acpi_io.h>
 #include <acpi/video.h>
 
 #include <drm/drmP.h>
similarity index 87%
rename from include/linux/acpi_io.h
rename to include/acpi/acpi_io.h
index 2a5a1391ce727b17d165298a416608841d266d63..2be858018c7f449cc7ca258eedb5e3785d6d7099 100644 (file)
@@ -2,7 +2,6 @@
 #define _ACPI_IO_H_
 
 #include <linux/io.h>
-#include <acpi/acpi.h> /* FIXME: inclusion should be removed */
 
 static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
                                            acpi_size size)
index d9099b15b4726404343308a39e5e55d39a16aa05..726a6aa62b64cb7ec3db495ad898492878844a71 100644 (file)
@@ -42,6 +42,7 @@
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 #include <acpi/acpi_numa.h>
+#include <acpi/acpi_io.h>
 #include <asm/acpi.h>
 
 static inline acpi_handle acpi_device_handle(struct acpi_device *adev)