aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi/acpi_bus.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-12-20 18:36:43 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-03 07:09:38 -0500
commita2d06a1a0851fb3d7e775b9d878cdffb9e0300ee (patch)
treedce31e492c9769838894f960fb84f32f3a3e1da7 /include/acpi/acpi_bus.h
parentca7b3c4f3d85bf7ec225eebb43b6af0a25499c6c (diff)
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/acpi_bus.h')
-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
63#define ACPI_BUS_FILE_ROOT "acpi" 63#define ACPI_BUS_FILE_ROOT "acpi"
64extern struct proc_dir_entry *acpi_root_dir; 64extern struct proc_dir_entry *acpi_root_dir;
65 65
66enum acpi_bus_add_type {
67 ACPI_BUS_ADD_BASIC = 0,
68 ACPI_BUS_ADD_MATCH,
69 ACPI_BUS_ADD_START,
70 ACPI_BUS_ADD_TYPE_COUNT
71};
72
66enum acpi_bus_removal_type { 73enum acpi_bus_removal_type {
67 ACPI_BUS_REMOVAL_NORMAL = 0, 74 ACPI_BUS_REMOVAL_NORMAL = 0,
68 ACPI_BUS_REMOVAL_EJECT, 75 ACPI_BUS_REMOVAL_EJECT,
@@ -95,12 +102,6 @@ typedef int (*acpi_op_bind) (struct acpi_device * device);
95typedef int (*acpi_op_unbind) (struct acpi_device * device); 102typedef int (*acpi_op_unbind) (struct acpi_device * device);
96typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event); 103typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event);
97 104
98struct acpi_bus_ops {
99 u32 acpi_op_add:1;
100 u32 acpi_op_start:1;
101 u32 acpi_op_match:1;
102};
103
104struct acpi_device_ops { 105struct acpi_device_ops {
105 acpi_op_add add; 106 acpi_op_add add;
106 acpi_op_remove remove; 107 acpi_op_remove remove;
@@ -284,7 +285,7 @@ struct acpi_device {
284 struct acpi_driver *driver; 285 struct acpi_driver *driver;
285 void *driver_data; 286 void *driver_data;
286 struct device dev; 287 struct device dev;
287 struct acpi_bus_ops bus_ops; /* workaround for different code path for hotplug */ 288 enum acpi_bus_add_type add_type; /* how to handle adding */
288 enum acpi_bus_removal_type removal_type; /* indicate for different removal type */ 289 enum acpi_bus_removal_type removal_type; /* indicate for different removal type */
289 u8 physical_node_count; 290 u8 physical_node_count;
290 struct list_head physical_node_list; 291 struct list_head physical_node_list;