summaryrefslogtreecommitdiff
path: root/include/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-12-21 03:36:43 +0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-03 16:09:38 +0400
commita2d06a1a0851fb3d7e775b9d878cdffb9e0300ee (patch)
treedce31e492c9769838894f960fb84f32f3a3e1da7 /include/acpi
parentca7b3c4f3d85bf7ec225eebb43b6af0a25499c6c (diff)
downloadlinux-a2d06a1a0851fb3d7e775b9d878cdffb9e0300ee.tar.xz
ACPI: Replace struct acpi_bus_ops with enum type
Notice that one member of struct acpi_bus_ops, acpi_op_add, is not used anywhere any more and the relationship between its remaining members, acpi_op_match and acpi_op_start, is such that it doesn't make sense to set the latter without setting the former at the same time. Therefore, replace struct acpi_bus_ops with new a enum type, enum acpi_bus_add_type, with three values, ACPI_BUS_ADD_BASIC, ACPI_BUS_ADD_MATCH, ACPI_BUS_ADD_START, corresponding to both acpi_op_match and acpi_op_start unset, acpi_op_match set and acpi_op_start unset, and both acpi_op_match and acpi_op_start set, respectively. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Yinghai Lu <yinghai@kernel.org> Acked-by: Toshi Kani <toshi.kani@hp.com>
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/acpi_bus.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 016918c16c98..d5294798fdda 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -63,6 +63,13 @@ acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld
#define ACPI_BUS_FILE_ROOT "acpi"
extern struct proc_dir_entry *acpi_root_dir;
+enum acpi_bus_add_type {
+ ACPI_BUS_ADD_BASIC = 0,
+ ACPI_BUS_ADD_MATCH,
+ ACPI_BUS_ADD_START,
+ ACPI_BUS_ADD_TYPE_COUNT
+};
+
enum acpi_bus_removal_type {
ACPI_BUS_REMOVAL_NORMAL = 0,
ACPI_BUS_REMOVAL_EJECT,
@@ -95,12 +102,6 @@ typedef int (*acpi_op_bind) (struct acpi_device * device);
typedef int (*acpi_op_unbind) (struct acpi_device * device);
typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event);
-struct acpi_bus_ops {
- u32 acpi_op_add:1;
- u32 acpi_op_start:1;
- u32 acpi_op_match:1;
-};
-
struct acpi_device_ops {
acpi_op_add add;
acpi_op_remove remove;
@@ -284,7 +285,7 @@ struct acpi_device {
struct acpi_driver *driver;
void *driver_data;
struct device dev;
- struct acpi_bus_ops bus_ops; /* workaround for different code path for hotplug */
+ enum acpi_bus_add_type add_type; /* how to handle adding */
enum acpi_bus_removal_type removal_type; /* indicate for different removal type */
u8 physical_node_count;
struct list_head physical_node_list;