From: "Zhang, Yanmin" On Sat, 2007-05-05 at 22:29 +0200, Olaf Hering wrote: > On Sat, May 05, Andrew Morton wrote: > > > +gregkh-pci-pci-reduce-aer-init-error-information.patch > > include/linux/pci-acpi.h:57: error: expected ')' before 'handle' > make[4]: *** [drivers/pci/pcie/portdrv_pci.o] Error 1 > > acpi_handle is intel only. Sorry. I didn't check CONFIG_ACPI=n. The acpi header file inclusion is too complicated. Below patch against 2.6.21+gregkh-pci-pci-reduce-aer-init-error-information.patch fixes the compiling issue. I delete the acpi header file inclusion in aerdrv.h, and move function aer_osc_setup to another file. I tested it with both CONFIG_ACPI=y and CONFIG_ACPI=n. Signed-off-by: Zhang Yanmin Cc: Greg KH Signed-off-by: Andrew Morton --- drivers/pci/pcie/aer/Makefile | 2 drivers/pci/pcie/aer/aerdrv.h | 3 - drivers/pci/pcie/aer/aerdrv_acpi.c | 61 --------------------------- drivers/pci/pcie/aer/aerdrv_core.c | 41 ++++++++++++++++++ 4 files changed, 42 insertions(+), 65 deletions(-) diff -puN drivers/pci/pcie/aer/Makefile~fix-gregkh-pci-pci-reduce-aer-init-error-information drivers/pci/pcie/aer/Makefile --- a/drivers/pci/pcie/aer/Makefile~fix-gregkh-pci-pci-reduce-aer-init-error-information +++ a/drivers/pci/pcie/aer/Makefile @@ -4,5 +4,5 @@ obj-$(CONFIG_PCIEAER) += aerdriver.o -aerdriver-objs := aerdrv_errprint.o aerdrv_core.o aerdrv.o aerdrv_acpi.o +aerdriver-objs := aerdrv_errprint.o aerdrv_core.o aerdrv.o diff -puN drivers/pci/pcie/aer/aerdrv.h~fix-gregkh-pci-pci-reduce-aer-init-error-information drivers/pci/pcie/aer/aerdrv.h --- a/drivers/pci/pcie/aer/aerdrv.h~fix-gregkh-pci-pci-reduce-aer-init-error-information +++ a/drivers/pci/pcie/aer/aerdrv.h @@ -9,8 +9,6 @@ #define _AERDRV_H_ #include -#include -#include #include #define AER_NONFATAL 0 @@ -118,6 +116,5 @@ extern void aer_delete_rootport(struct a extern int aer_init(struct pcie_device *dev); extern void aer_isr(struct work_struct *work); extern void aer_print_error(struct pci_dev *dev, struct aer_err_info *info); -extern acpi_status aer_osc_setup(struct pci_dev *dev); #endif //_AERDRV_H_ diff -puN drivers/pci/pcie/aer/aerdrv_acpi.c~fix-gregkh-pci-pci-reduce-aer-init-error-information /dev/null --- a/drivers/pci/pcie/aer/aerdrv_acpi.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Access ACPI _OSC method - * - * Copyright (C) 2006 Intel Corp. - * Tom Long Nguyen (tom.l.nguyen@intel.com) - * Zhang Yanmin (yanmin.zhang@intel.com) - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "aerdrv.h" - -/** - * aer_osc_setup - run ACPI _OSC method - * - * Return: - * Zero if success. Nonzero for otherwise. - * - * Invoked when PCIE bus loads AER service driver. To avoid conflict with - * BIOS AER support requires BIOS to yield AER control to OS native driver. - **/ -acpi_status aer_osc_setup(struct pci_dev *dev) -{ - acpi_status status = AE_NOT_FOUND; - acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev); - struct pci_dev *pdev = dev; - struct pci_bus *parent; - - while (!handle) { - if (!pdev || !pdev->bus->parent) - break; - parent = pdev->bus->parent; - if (!parent->self) - /* Parent must be a host bridge */ - handle = acpi_get_pci_rootbridge_handle( - pci_domain_nr(parent), - parent->number); - else - handle = DEVICE_ACPI_HANDLE( - &(parent->self->dev)); - pdev = parent->self; - } - - if (!handle) - return status; - - pci_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT); - status = pci_osc_control_set(handle, OSC_PCI_EXPRESS_AER_CONTROL | - OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL); - - return status; -} - diff -puN drivers/pci/pcie/aer/aerdrv_core.c~fix-gregkh-pci-pci-reduce-aer-init-error-information drivers/pci/pcie/aer/aerdrv_core.c --- a/drivers/pci/pcie/aer/aerdrv_core.c~fix-gregkh-pci-pci-reduce-aer-init-error-information +++ a/drivers/pci/pcie/aer/aerdrv_core.c @@ -726,6 +726,47 @@ void aer_delete_rootport(struct aer_rpc } /** + * aer_osc_setup - run ACPI _OSC method + * + * Return: + * Zero if success. Nonzero for otherwise. + * + * Invoked when PCIE bus loads AER service driver. To avoid conflict with + * BIOS AER support requires BIOS to yield AER control to OS native driver. + **/ +acpi_status aer_osc_setup(struct pci_dev *dev) +{ + acpi_status status = AE_NOT_FOUND; + acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev); + struct pci_dev *pdev = dev; + struct pci_bus *parent; + + while (!handle) { + if (!pdev || !pdev->bus->parent) + break; + parent = pdev->bus->parent; + if (!parent->self) + /* Parent must be a host bridge */ + handle = acpi_get_pci_rootbridge_handle( + pci_domain_nr(parent), + parent->number); + else + handle = DEVICE_ACPI_HANDLE( + &(parent->self->dev)); + pdev = parent->self; + } + + if (!handle) + return status; + + pci_osc_support_set(OSC_EXT_PCI_CONFIG_SUPPORT); + status = pci_osc_control_set(handle, OSC_PCI_EXPRESS_AER_CONTROL | + OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL); + + return status; +} + +/** * aer_init - provide AER initialization * @dev: pointer to AER pcie device * _