diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-11-22 21:56:06 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-11-22 21:56:06 +0100 |
commit | 25db115b0bf72acfdf8a339fa8e37d8b895214d6 (patch) | |
tree | 57e73fb5457a5ecb591a8f750583274006afe763 /include/acpi/acpi_bus.h | |
parent | ACPI / hotplug: Drop unfinished global notification handling routines (diff) | |
download | linux-25db115b0bf72acfdf8a339fa8e37d8b895214d6.tar.xz linux-25db115b0bf72acfdf8a339fa8e37d8b895214d6.zip |
ACPI: Introduce acpi_set_device_status()
Introduce a static inline function for setting the status field
of struct acpi_device on the basis of a supplied u32 number,
acpi_set_device_status(), and use it instead of the horrible
horrible STRUCT_TO_INT() macro wherever applicable. Having done
that, drop STRUCT_TO_INT() (and pretend that it has never existed).
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to '')
-rw-r--r-- | include/acpi/acpi_bus.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 3e4150b6d71a..95831e7b70be 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -320,6 +320,11 @@ static inline void *acpi_driver_data(struct acpi_device *d) #define to_acpi_device(d) container_of(d, struct acpi_device, dev) #define to_acpi_driver(d) container_of(d, struct acpi_driver, drv) +static inline void acpi_set_device_status(struct acpi_device *adev, u32 sta) +{ + *((u32 *)&adev->status) = sta; +} + /* acpi_device.dev.bus == &acpi_bus_type */ extern struct bus_type acpi_bus_type; |