提交 caaa6efb 编写于 作者: B Bjorn Helgaas 提交者: Len Brown

ACPI: save device_type in acpi_device

Most uses of the ACPI bus device_type (ACPI_BUS_TYPE_DEVICE,
ACPI_BUS_TYPE_POWER, etc) are during device initialization, but
we do need it later for notify handler installation, since that
is different for fixed hardware devices vs. namespace devices.

This patch saves the device_type in the acpi_device structure,
so we can check that rather than comparing against the _HID string.
Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 66b7ed40
...@@ -1240,6 +1240,7 @@ acpi_add_single_object(struct acpi_device **child, ...@@ -1240,6 +1240,7 @@ acpi_add_single_object(struct acpi_device **child,
return -ENOMEM; return -ENOMEM;
} }
device->device_type = type;
device->handle = handle; device->handle = handle;
device->parent = parent; device->parent = parent;
device->bus_ops = *ops; /* workround for not call .start */ device->bus_ops = *ops; /* workround for not call .start */
......
...@@ -262,7 +262,8 @@ struct acpi_device_wakeup { ...@@ -262,7 +262,8 @@ struct acpi_device_wakeup {
/* Device */ /* Device */
struct acpi_device { struct acpi_device {
acpi_handle handle; int device_type;
acpi_handle handle; /* no handle for fixed hardware */
struct acpi_device *parent; struct acpi_device *parent;
struct list_head children; struct list_head children;
struct list_head node; struct list_head node;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册