OpenCloudOS-Kernel/drivers/pci/hotplug
Rafael J. Wysocki 7b1998116b ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node
Modify struct acpi_dev_node to contain a pointer to struct acpi_device
associated with the given device object (that is, its ACPI companion
device) instead of an ACPI handle corresponding to it.  Introduce two
new macros for manipulating that pointer in a CONFIG_ACPI-safe way,
ACPI_COMPANION() and ACPI_COMPANION_SET(), and rework the
ACPI_HANDLE() macro to take the above changes into account.
Drop the ACPI_HANDLE_SET() macro entirely and rework its users to
use ACPI_COMPANION_SET() instead.  For some of them who used to
pass the result of acpi_get_child() directly to ACPI_HANDLE_SET()
introduce a helper routine acpi_preset_companion() doing an
equivalent thing.

The main motivation for doing this is that there are things
represented by struct acpi_device objects that don't have valid
ACPI handles (so called fixed ACPI hardware features, such as
power and sleep buttons) and we would like to create platform
device objects for them and "glue" them to their ACPI companions
in the usual way (which currently is impossible due to the
lack of valid ACPI handles).  However, there are more reasons
why it may be useful.

First, struct acpi_device pointers allow of much better type checking
than void pointers which are ACPI handles, so it should be more
difficult to write buggy code using modified struct acpi_dev_node
and the new macros.  Second, the change should help to reduce (over
time) the number of places in which the result of ACPI_HANDLE() is
passed to acpi_bus_get_device() in order to obtain a pointer to the
struct acpi_device associated with the given "physical" device,
because now that pointer is returned by ACPI_COMPANION() directly.
Finally, the change should make it easier to write generic code that
will build both for CONFIG_ACPI set and unset without adding explicit
compiler directives to it.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> # on Haswell
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Aaron Lu <aaron.lu@intel.com> # for ATA and SDIO part
2013-11-14 23:14:43 +01:00
..
Kconfig s390/pci/hotplug: convert to be builtin only 2013-08-30 08:57:07 +02:00
Makefile s390/pci: PCI hotplug support via SCLP 2012-11-30 17:47:25 +01:00
acpi_pcihp.c PCI changes for the v3.13 merge window: 2013-11-14 14:02:00 +09:00
acpiphp.h PCI: acpiphp: Convert to dynamic debug 2013-09-25 17:00:51 -06:00
acpiphp_core.c PCI: acpiphp: Convert to dynamic debug 2013-09-25 17:00:51 -06:00
acpiphp_glue.c PCI changes for the v3.13 merge window: 2013-11-14 14:02:00 +09:00
acpiphp_ibm.c PCI: acpiphp_ibm: Convert to dynamic debug 2013-09-25 17:00:51 -06:00
cpci_hotplug.h PCI: Remove "extern" from function declarations 2013-04-17 10:21:17 -06:00
cpci_hotplug_core.c PCI: hotplug: ensure a consistent return value in error case 2012-07-16 09:25:56 -06:00
cpci_hotplug_pci.c PCI: cpcihp: Iterate over all devices in slot, not functions 0-7 2013-01-25 09:23:08 -07:00
cpcihp_generic.c PCI/cpcihp: Use hotplug-safe pci_get_domain_bus_and_slot() 2012-09-12 14:13:59 -06:00
cpcihp_zt5550.c PCI: Remove __dev* markings 2012-11-28 13:16:47 -08:00
cpcihp_zt5550.h
cpqphp.h PCI: Remove "extern" from function declarations 2013-04-17 10:21:17 -06:00
cpqphp_core.c PCI: hotplug: ensure a consistent return value in error case 2012-07-16 09:25:56 -06:00
cpqphp_ctrl.c PCI: cpqphp: Cleanup and remove unreachable paths 2013-01-07 11:34:04 -07:00
cpqphp_nvram.c PCI Hotplug: cpqphp: fix comment style 2009-06-11 12:04:08 -07:00
cpqphp_nvram.h PCI: Remove "extern" from function declarations 2013-04-17 10:21:17 -06:00
cpqphp_pci.c PCI: cpqhp: use generic pci_hp_add_bridge() 2012-06-13 15:42:26 -06:00
cpqphp_sysfs.c cpqphp_sysfs: switch to fixed_size_llseek() 2013-06-29 12:57:52 +04:00
ibmphp.h PCI: Remove "extern" from function declarations 2013-04-17 10:21:17 -06:00
ibmphp_core.c PCI changes for the 3.6 merge window: 2012-07-24 16:17:07 -07:00
ibmphp_ebda.c pci: hotplug: Fix typo in pci 2012-07-24 12:59:30 +02:00
ibmphp_hpc.c PCI hotplug: ibmphp-hpc: semaphore cleanup 2010-10-15 13:09:48 -07:00
ibmphp_pci.c pci: hotplug: Fix typo in pci 2012-07-24 12:59:30 +02:00
ibmphp_res.c ibmphp: Rename add_range() to add_bus_range() to avoid conflict 2010-02-10 17:45:09 -08:00
pci_hotplug_core.c PCI: Remove __must_check from definitions 2013-04-17 10:20:58 -06:00
pciehp.h PCI: pciehp: Add reset_slot() method 2013-08-14 14:55:26 -06:00
pciehp_acpi.c PCI: Use PCI_EXP_SLTCAP_PSN mask when extracting slot number 2013-04-15 14:30:44 -06:00
pciehp_core.c PCI: pciehp: Add reset_slot() method 2013-08-14 14:55:26 -06:00
pciehp_ctrl.c PCI: pciehp: Use per-slot workqueues to avoid deadlock 2013-01-12 13:56:33 -07:00
pciehp_hpc.c PCI: pciehp: Add reset_slot() method 2013-08-14 14:55:26 -06:00
pciehp_pci.c PCI: pciehp: Fix null pointer deref when hot-removing SR-IOV device 2013-07-25 14:11:06 -06:00
pcihp_skeleton.c PCI: hotplug: ensure a consistent return value in error case 2012-07-16 09:25:56 -06:00
pcihp_slot.c PCI: Simplify pcie_bus_configure_settings() interface 2013-08-22 10:47:02 -06:00
rpadlpar.h PCI: Remove "extern" from function declarations 2013-04-17 10:21:17 -06:00
rpadlpar_core.c powerpc/pci/hotplug: Don't need to remove from EEH cache twice 2013-07-24 14:18:47 +10:00
rpadlpar_sysfs.c PCI: introduce pci_slot 2008-06-10 14:37:03 -07:00
rpaphp.h PCI: Remove "extern" from function declarations 2013-04-17 10:21:17 -06:00
rpaphp_core.c module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
rpaphp_pci.c PCI hotplug: rpaphp: make debug var unique 2008-10-20 10:54:27 -07:00
rpaphp_slot.c headers: kobject.h redux 2011-01-10 08:51:44 -08:00
s390_pci_hpc.c s390/pci: message cleanup 2013-10-24 17:17:15 +02:00
sgi_hotplug.c ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node 2013-11-14 23:14:43 +01:00
shpchp.h PCI/ACPI: Name _OSC #defines more consistently 2013-09-23 17:40:45 -06:00
shpchp_core.c drivers: avoid format strings in names passed to alloc_workqueue() 2013-07-03 16:07:41 -07:00
shpchp_ctrl.c PCI: shpchp: Use per-slot workqueues to avoid deadlock 2013-01-14 10:23:22 -07:00
shpchp_hpc.c PCI hotplug: shpchp: don't blindly claim non-AMD 0x7450 device IDs 2011-11-14 09:43:14 -08:00
shpchp_pci.c PCI: shpchp: Iterate over all devices in slot, not functions 0-7 2013-01-25 09:23:08 -07:00
shpchp_sysfs.c PCI: Remove __must_check from definitions 2013-04-17 10:20:58 -06:00