OpenCloudOS-Kernel/drivers
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
..
accessibility
acpi ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node 2013-11-14 23:14:43 +01:00
amba DMA-API: amba: get rid of separate dma_mask 2013-10-31 14:48:38 +00:00
ata ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node 2013-11-14 23:14:43 +01:00
atm atm: firestream: remove duplicate define 2013-10-21 18:46:46 -04:00
auxdisplay
base ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node 2013-11-14 23:14:43 +01:00
bcma Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-11-13 17:40:34 +09:00
block Merge branch 'for-3.13/drivers' of git://git.kernel.dk/linux-block 2013-11-14 12:13:05 +09:00
bluetooth Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth 2013-11-05 15:58:21 -05:00
bus Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 08:51:29 +09:00
cdrom
char Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-11-13 17:40:34 +09:00
clk DeviceTree updates for 3.13. This is a bit larger pull request than 2013-11-12 16:52:17 +09:00
clocksource clocksource: sun4i: remove IRQF_DISABLED 2013-10-22 22:36:50 +02:00
connector
cpufreq ACPI and power management updates for 3.13-rc1 2013-11-14 13:41:48 +09:00
cpuidle ACPI and power management updates for 3.13-rc1 2013-11-14 13:41:48 +09:00
crypto Merge branch 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 07:55:21 +09:00
dca
devfreq Merge branch 'pm-devfreq' 2013-11-07 19:24:20 +01:00
dio
dma Merge branch 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 07:55:21 +09:00
edac DeviceTree updates for 3.13. This is a bit larger pull request than 2013-11-12 16:52:17 +09:00
eisa
extcon
firewire
firmware Merge branch 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 07:55:21 +09:00
fmc
gpio ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node 2013-11-14 23:14:43 +01:00
gpu ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node 2013-11-14 23:14:43 +01:00
hid ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node 2013-11-14 23:14:43 +01:00
hsi
hv Drivers: hv: vmbus: Fix a bug in channel rescind code 2013-10-19 19:53:46 -07:00
hwmon spi: Updates for v3.13 2013-11-12 15:01:39 +09:00
hwspinlock
i2c ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node 2013-11-14 23:14:43 +01:00
ide ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node 2013-11-14 23:14:43 +01:00
idle ACPI and power management updates for 3.13-rc1 2013-11-14 13:41:48 +09:00
iio iio: light: vcnl4000: Remove redundant code 2013-10-24 14:48:14 +01:00
infiniband PCI changes for the v3.13 merge window: 2013-11-14 14:02:00 +09:00
input DeviceTree updates for 3.13. This is a bit larger pull request than 2013-11-12 16:52:17 +09:00
iommu ACPI and power management updates for 3.13-rc1 2013-11-14 13:41:48 +09:00
ipack
irqchip Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 08:51:29 +09:00
isdn isdn: icn: NULL dereference printing error message 2013-11-07 19:11:13 -05:00
leds leds: lp55xx: handle enable pin in driver 2013-10-25 10:13:25 -07:00
lguest
macintosh DeviceTree updates for 3.13. This is a bit larger pull request than 2013-11-12 16:52:17 +09:00
mailbox
md A set of device-mapper changes for 3.13. 2013-11-14 12:35:48 +09:00
media Merge branch 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 07:55:21 +09:00
memory
memstick drivers/memstick/core/ms_block.c: fix unreachable state in h_msb_read_page() 2013-11-13 12:09:35 +09:00
message drivers/message/i2o/driver.c: add missing destroy_workqueue() on error in i2o_driver_register() 2013-11-13 12:09:26 +09:00
mfd sound updates for 3.13-rc1 2013-11-12 15:29:53 +09:00
misc DeviceTree updates for 3.13. This is a bit larger pull request than 2013-11-12 16:52:17 +09:00
mmc ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node 2013-11-14 23:14:43 +01:00
mtd MTD merge for 3.13 2013-11-14 12:31:43 +09:00
net Merge branch 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 07:55:21 +09:00
nfc
ntb
nubus
of Merge branch 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 07:55:21 +09:00
oprofile
parisc
parport Merge branch 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 07:55:21 +09:00
pci ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node 2013-11-14 23:14:43 +01:00
pcmcia DeviceTree updates for 3.13. This is a bit larger pull request than 2013-11-12 16:52:17 +09:00
phy usb: patches for v3.13 2013-10-24 16:18:40 +01:00
pinctrl GPIO bulk changes for the v3.13 development cycle 2013-11-12 15:50:46 +09:00
platform ACPI and power management updates for 3.13-rc1 2013-11-14 13:41:48 +09:00
pnp ACPI and power management updates for 3.13-rc1 2013-11-14 13:41:48 +09:00
power
powercap PowerCap: Fix build error with option -Werror=format-security 2013-11-05 02:36:57 +01:00
pps drivers/pps/clients/pps-gpio.c: remove redundant of_match_ptr 2013-11-13 12:09:35 +09:00
ps3
ptp
pwm
rapidio
regulator Merge remote-tracking branch 'regulator/topic/tps65910' into regulator-next 2013-10-24 11:11:43 +01:00
remoteproc
reset
rpmsg
rtc drivers/rtc/rtc-as3722: add RTC driver 2013-11-13 12:09:31 +09:00
s390 Merge branch 'for-3.13/drivers' of git://git.kernel.dk/linux-block 2013-11-14 12:13:05 +09:00
sbus
scsi PCI changes for the v3.13 merge window: 2013-11-14 14:02:00 +09:00
sfi
sh
sn
spi ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node 2013-11-14 23:14:43 +01:00
ssb
staging PCI changes for the v3.13 merge window: 2013-11-14 14:02:00 +09:00
target target/pscsi: fix return value check 2013-10-25 10:42:09 -07:00
tc
thermal Merge branch 'pm-cpufreq' 2013-10-28 01:29:34 +01:00
tty DeviceTree updates for 3.13. This is a bit larger pull request than 2013-11-12 16:52:17 +09:00
uio drivers/uio/uio_pruss.c: use gen_pool_dma_alloc() to allocate sram memory 2013-11-13 12:09:23 +09:00
usb Merge branch 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 07:55:21 +09:00
uwb Driver Core / sysfs patches for 3.13-rc1 2013-11-07 11:42:15 +09:00
vfio
vhost vhost/scsi: Fix incorrect usage of get_user_pages_fast write parameter 2013-10-25 11:03:34 -07:00
video ACPI and power management updates for 3.13-rc1 2013-11-14 13:41:48 +09:00
virt
virtio
vlynq
vme
w1 drivers: w1: make w1_slave::flags long to avoid memory corruption 2013-11-13 12:09:35 +09:00
watchdog DeviceTree updates for 3.13. This is a bit larger pull request than 2013-11-12 16:52:17 +09:00
xen xenbus: convert bus code to use dev_groups 2013-10-16 18:36:03 -07:00
zorro
Kconfig ACPI and power management updates for 3.13-rc1 2013-11-14 13:41:48 +09:00
Makefile ACPI and power management updates for 3.13-rc1 2013-11-14 13:41:48 +09:00